Zero Signup ToolsFree browser tools

Calculator Tools

Shannon Entropy Calculator

Calculate the Shannon entropy of any text or string in bits per character, byte, or word, with a frequency table and redundancy, free in your browser.

72 chars
Try a sample:

Count entropy by

Result

Shannon entropy

4.3430

bits per character

Total entropy

312.69

bits, about 40 bytes

Max entropy

4.8580

bits per character, uniform alphabet

Efficiency

89.4%

redundancy 10.6%

Symbols

29 / 72

distinct / total

Nats per character

3.0103

natural log, base e

Dits per character

1.3074

hartleys, base 10

Shannon entropy measures the average information per character from the symbol distribution. It is not the same as charset password entropy. A long run of one repeated character scores near zero because there is almost no uncertainty.

Symbol frequency and contribution

showing 29 of 29 distinct characters
SymbolCountProbabilityBits eachShare of total
space1419.44%2.363
10.6%
e68.33%3.585
6.9%
a56.94%3.848
6.2%
r56.94%3.848
6.2%
n45.56%4.170
5.3%
o45.56%4.170
5.3%
h34.17%4.585
4.4%
t34.17%4.585
4.4%
b22.78%5.170
3.3%
d22.78%5.170
3.3%
i22.78%5.170
3.3%
k22.78%5.170
3.3%
u22.78%5.170
3.3%
v22.78%5.170
3.3%
w22.78%5.170
3.3%
.11.39%6.170
2.0%
c11.39%6.170
2.0%
f11.39%6.170
2.0%
g11.39%6.170
2.0%
j11.39%6.170
2.0%
l11.39%6.170
2.0%
m11.39%6.170
2.0%
p11.39%6.170
2.0%
q11.39%6.170
2.0%
s11.39%6.170
2.0%
T11.39%6.170
2.0%
x11.39%6.170
2.0%
y11.39%6.170
2.0%
z11.39%6.170
2.0%

How the number is found

H = - Σ p(x) · log₂ p(x)
Each distinct character x has probability p(x) equal to its count divided by the total. Sum the surprise of every character weighted by how often it appears, and you get the average bits per character.

Total entropy is H multiplied by the character count, which is the information-theoretic floor in bits for storing this exact data with an ideal order-0 coder. Real compressors can do better when there is structure across characters, or worse on tiny inputs because of overhead.

How to use

  1. Paste or type any text, password, token, or string into the input area, or click a sample to load one.
  2. Pick how a symbol is counted: characters (Unicode code points), bytes (UTF-8), or words.
  3. Read the Shannon entropy in bits per symbol, plus total entropy, maximum entropy, efficiency, and redundancy.
  4. Scan the frequency table to see each symbol's probability, bits, and share of the total information.
  5. Use Copy summary to grab the full set of figures for a report or note.

About this tool

Shannon Entropy Calculator measures the information content of any text or string using Claude Shannon's formula H = - sum of p(x) times log2 p(x), entirely in your browser with nothing uploaded. Entropy is reported in bits per symbol, where a symbol is defined the way you choose: characters (Unicode code points, so an emoji counts as one), bytes (the UTF-8 byte sequence, which matches what most command-line entropy tools report), or words (whitespace-separated tokens). For each definition the tool computes the per-symbol entropy, the total entropy for the whole message (bits per symbol multiplied by the symbol count, with the equivalent in bytes), the maximum possible entropy for an alphabet of that size (log2 of the distinct symbol count, the entropy of a uniform distribution), the efficiency or metric entropy (H divided by the maximum, from 0 to 1), and the redundancy (one minus efficiency). It also converts the result into nats (natural log, base e) and dits or hartleys (base 10) for textbook and engineering contexts. A sortable frequency table lists each distinct symbol with its count, probability, the bits it carries individually (its surprise, minus log2 of its probability), and its share of the total entropy, with a contribution bar so you can see at a glance which symbols dominate. This is the information-theoretic notion of entropy, which is different from the charset-pool password entropy formula (length times log2 of alphabet size) used by a password entropy calculator: Shannon entropy reflects how skewed the observed distribution actually is, so a long run of one repeated character scores near zero no matter how long it is, while a perfectly uniform random string approaches its maximum. The total entropy figure is also a useful intuition for compressibility, because it is the floor in bits for representing the exact data with an ideal order-0 entropy coder, although real compressors beat or miss that floor depending on structure that spans multiple symbols. Useful for students learning information theory, data scientists checking how random a column or identifier looks, security engineers eyeballing the diversity of a token or key, writers and linguists studying character and word distributions, and anyone curious how many bits of real information a password, hash, DNA sequence, or sentence actually carries. Everything runs locally, so the text you analyze never leaves your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsCalculator Tools