Four symbols with counts 4, 3, 2, 1. Entropy 1.8464393447 bits against a maximum of 2 for four symbols — an efficiency of 0.923220.
10 symbols, 4 distinct
H = 1.8464393447 bits
The maximum for 4 distinct symbols is 2.000000 bits, so the efficiency is 0.923220 and the redundancy 0.153561 bits. Perplexity is 3.5961 — this distribution carries as much uncertainty as a uniform choice among that many equally likely options. In other units: 1.279854 nats or 0.555834 bans.
Entropy
1.846439 bits
max 2.0000
Efficiency
0.923220
H ÷ log₂(distinct)
Perplexity
3.59612
equally likely options this is worth
Inverse Simpson
3.33333
another effective count
Each symbol with its count, probability and contribution to the entropy
Symbol
Count
p
−p log₂ p
Share of H
A
4
0.400000
0.528771
28.6%
B
3
0.300000
0.521090
28.2%
C
2
0.200000
0.464386
25.2%
D
1
0.100000
0.332193
18.0%
Rearrange those symbols in any order at all and every number on this page is unchanged. Entropy reads the frequency column and never the sequence — so it cannot tell a sorted list from a shuffled one, and is not a measure of how random something looks.
Maximum at a uniform distribution, log₂(k) Bits, nats and bans differ only by a constant Blind to order, by construction
What this tool shows
AAAABBBCCD and ABACABDCBA both have an entropy of 1.8464393447 bits — identical to the last digit. Entropy reads the frequency table and never the sequence, so a sorted list and any rearrangement of it are the same to it. That is the property most often misread: entropy is not a measure of how random something looks, and a high value is not evidence of disorder in any ordinary sense.
Entropy in bits, nats and bans, from any list of symbols
Each symbol’s probability and its −p log₂ p contribution
The maximum for that many distinct symbols, and the efficiency against it
Perplexity — how many equally likely options the distribution is worth
Gini-Simpson and inverse Simpson diversity, for contrast
The order-blindness demonstrated with two presets rather than asserted
Bits, nats, bans Per-symbol table Perplexity Simpson indices
Entropy is blind to order. It is not a randomness test.
Updated 13 September 2026 · Works in any browser, no installation
Shannon entropy is the average number of bits needed to identify one outcome drawn from a distribution. A fair coin is 1 bit, a fair die is log₂6 ≈ 2.585, and a certainty is 0. It is the theoretical floor for lossless compression of that source, and it depends only on how often each symbol occurs — never on the order they occur in.
At a glance
Formula shown
H = −Σ pᵢ log₂ pᵢ over the distinct symbols, where pᵢ is the relative frequency of symbol i. The maximum for k distinct symbols is log₂ k, reached only when all are equally likely, and efficiency is H divided by that. Perplexity is 2^H — the size of a uniform distribution carrying the same uncertainty. Nats and bans are the same quantity with log base e and 10: H_nats = H_bits · ln 2.
Scenario support
Password and key strength, decision-tree splitting and information gain, language and text statistics, compression bounds, species and market diversity, and measuring how concentrated any categorical distribution is.
Educational estimate
Planning support from the values you enter — not professional advice.
It reads the frequency table, never the sequence
The tool ships the demonstration as two presets, because the claim is exact and easy to check.
AAAABBBCCD gives 1.8464393447 bits. ABACABDCBA — the same ten symbols, shuffled — gives 1.8464393447. Every number on the page is unchanged.
Which means entropy cannot detect a pattern. ABABABABAB and AABBAABBAA and a genuinely random string with the same letter counts all score identically, and one of them is perfectly predictable.
So entropy is not a randomness test. For that you need something that looks at order — a runs test on the sequence, or a higher-order entropy that counts pairs and triples rather than single symbols.
The fix is conditional entropy. H of the next symbol GIVEN the previous one drops sharply for ABABAB and not at all for a random string, which is how compression algorithms and language models capture what single-symbol entropy misses.
Which is also why English text has an entropy of about 4.1 bits per letter by single-letter frequencies and roughly 1.1 bits once context is taken into account — the gap is entirely the order this measure ignores.
The maximum is uniform, and efficiency measures the distance
Entropy is bounded above by log₂ of the number of distinct symbols, and that bound is reached only at a uniform distribution.
Four symbols cap at 2 bits. The tool’s third preset — three of each of four symbols — hits exactly 2.0000000000, and its efficiency is exactly 1.
Efficiency is H divided by that maximum, so it runs from 0 to 1 and is comparable across alphabets of different sizes in a way raw entropy is not.
Redundancy is the leftover, log₂k − H, and it is what a compressor can exploit. A source with 0.15 bits of redundancy per symbol can be compressed by about 7.5% before any modelling of order.
Adding a symbol that almost never occurs raises the maximum more than the entropy, so efficiency falls — which is why efficiency, not entropy, is the right measure when the number of categories varies.
Perplexity turns bits into a count you can picture
Bits are hard to feel. 2 raised to the entropy is not.
Perplexity is 2ᴴ, the size of the uniform distribution carrying the same uncertainty. The first preset has entropy 1.8464 bits and a perplexity of 3.5961 — as uncertain as a fair choice among about three and a half options.
A fair coin has perplexity 2 and a fair die 6, by construction, which is what makes the number readable.
It is the standard reporting unit for language models, where “perplexity 20” means the model is as uncertain about the next word as if choosing uniformly among twenty.
The inverse Simpson index is a near-relative, 1/Σp², and is the “effective number of species” in ecology. On the first preset it is 3.3333 against a perplexity of 3.5961 — both answer “how many equally common categories is this worth?” and weight rare categories differently.
Bits, nats and bans differ by a constant and nothing else
The choice of logarithm base is a choice of unit, like metres against feet. Nothing about the distribution changes.
Bits use log₂ and are the default wherever information is stored or transmitted, because a bit is a binary decision.
Nats use the natural log and are standard in statistics and machine learning, because derivatives of ln are tidier. H_nats = H_bits × ln 2 ≈ 0.693 × H_bits.
Bans use log₁₀ and are the oldest of the three — named for Banbury, where the sheets used at Bletchley Park were printed.
The tool prints all three because papers mix them freely and a cross-entropy or KL divergence quoted without its unit is ambiguous by a factor of 1.44.
Entropy estimated from a sample is biased downward
Everything above treats the observed frequencies as the truth. When they are a sample, the plug-in estimate is systematically too small.
Symbols you did not observe contribute nothing, so a sample of 20 from a 1,000-symbol alphabet reports at most log₂20 = 4.32 bits however uniform the source is.
The bias is roughly (k−1)/(2n ln 2) bits, where k is the number of distinct symbols actually seen — the Miller-Madow correction adds it back, and it is large exactly when n is small relative to k.
Which makes entropy comparisons across samples of different sizes unsound unless corrected, in the same way that eta squared is biased upward by its own degrees of freedom.
This tool reports the plug-in estimate on the data you give it, which is the right answer when the list IS the population — a market’s shares, a text’s letters — and a downward-biased one when it is a sample from something larger.
Reporting an entropy
Four things, and the first is the one that makes a figure comparable at all.
Give the unit. Bits, nats or bans — a bare “entropy 2.4” differs by a factor of 1.44 depending on which was meant.
Give the number of distinct symbols. It sets the maximum, and without it the reader cannot tell whether 2.4 bits is nearly uniform or badly concentrated.
Prefer efficiency when alphabets differ. It is entropy divided by its own maximum, so it compares across sources with different numbers of categories.
And say whether the data is the population or a sample. The plug-in estimate is unbiased for the first and too small for the second.
Sources and methodology
References for Shannon entropy and its estimation.
Method. Entropy is computed as −Σp log₂p over the observed frequencies, with the per-symbol contributions retained so the table sums to the reported total rather than being derived from it. The order-blindness claim is a preset pair rather than a sentence: the shipped sorted and shuffled sequences contain the identical multiset of symbols, and the suite asserts that every generated permutation of a sequence produces a bit-identical entropy. Nats and bans are the same quantity scaled by ln 2 and ln 2/ln 10 rather than recomputed, so the three can never disagree. Perplexity is 2 raised to the entropy and the inverse Simpson index is computed independently from the squared probabilities, which is why the two “effective number” measures differ on the same data rather than being one number twice. An empty input returns no result. That engine is verified on every change against 100 assertions. The count and the per-case breakdown are published on the formula verification page.
Related calculators
Where this goes next:
Mutual InformationDependence a correlation misses: y = x squared gives a Pearson r of exactly 0 and 1.358298 bits — with the binning bias measured on unrelated data rather than glossed over.
Gini CoefficientGini with the Lorenz curve, top and bottom shares and the Palma ratio — because two societies with a Gini of exactly 0.50 can have bottom-50% shares of 0% and 22%.
Herfindahl IndexHHI with each firm's contribution, the numbers-equivalent and the exact merger delta: merging the top two adds precisely 2 x s1 x s2, whatever else is in the market.
Runs TestThe Wald-Wolfowitz test with every run boundary drawn: ten 1s then ten 0s gives z = −3.9055 and perfect alternation +3.9055 — identical counts, mirror-image results, which no frequency test can see.
ProbabilityTwo events, repeated trials and Bayes, with the three usual errors handled — the dropped overlap in P(A or B), n×p instead of the complement, and the base rate that makes a 99% test 17% right.
Frequency DistributionA frequency table with relative and cumulative columns, and all six standard bin-count rules computed at once — they disagree by a factor of 6.67 at n = 10,000, where Sturges asks for 15 bins and the square-root rule asks for 100.
An educational tool. Shannon entropy depends only on the frequency of each symbol and never on their order, so it cannot distinguish a perfectly predictable sequence from a random one with the same counts — it is not a randomness test. Estimated from a sample rather than a full population it is also biased downward, by roughly (k−1)/(2n ln 2) bits.
Published an entropy tool reporting bits, nats and bans with the per-symbol −p log₂ p contributions, so the table sums to the headline rather than being derived from it.
Built the page on the property most often misread, and shipped it as two presets rather than a sentence: AAAABBBCCD and ABACABDCBA both give 1.8464393447 bits, identical to the last digit. The suite asserts that every one of 300 generated shuffles returns a bit-identical value.
Which means entropy cannot distinguish ABABABABAB from a random string with the same counts — it is not a randomness test, and the page says so rather than leaving a reader to assume otherwise.
Added efficiency against the uniform maximum, since raw entropy is not comparable across alphabets of different sizes, and perplexity as the readable form: 3.5961 equally likely options rather than 1.8464 bits.
Recorded that the plug-in estimate is biased DOWNWARD when the data is a sample rather than a population, by roughly (k−1)/(2n ln 2) bits — the opposite direction from most estimation problems.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.