We present a necessary and sufficient condition to falsify whether a Hawking radiation spectrum indicates unitary emission process or not from the perspective of information theory. With this condition, we show the precise values of Bekenstein-Hawking entropies for Schwarzschild black holes and Reissner-Nordstrom black holes can be calculated by counting the microstates of their Hawking radiations. In particular, for the extremal Reissner-Nordstrom black hole, its number of microstate and the corresponding entropy we obtain are found to be consistent with the string theory results. Our finding helps to refute the dispute about the Bekenstein-Hawking entropy of extremal black holes in the semiclassical limit.