As it is well known in statistical physics the stationary distribution can be obtained by maximizing entropy. We show how one can reconstruct the formula for entropy knowing the formula for the stationary distribution. A general case is discussed and some concrete physical examples are considered.