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.
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| Symbol | Count | Probability | Bits each | Share of total |
|---|---|---|---|---|
| space | 14 | 19.44% | 2.363 | 10.6% |
| e | 6 | 8.33% | 3.585 | 6.9% |
| a | 5 | 6.94% | 3.848 | 6.2% |
| r | 5 | 6.94% | 3.848 | 6.2% |
| n | 4 | 5.56% | 4.170 | 5.3% |
| o | 4 | 5.56% | 4.170 | 5.3% |
| h | 3 | 4.17% | 4.585 | 4.4% |
| t | 3 | 4.17% | 4.585 | 4.4% |
| b | 2 | 2.78% | 5.170 | 3.3% |
| d | 2 | 2.78% | 5.170 | 3.3% |
| i | 2 | 2.78% | 5.170 | 3.3% |
| k | 2 | 2.78% | 5.170 | 3.3% |
| u | 2 | 2.78% | 5.170 | 3.3% |
| v | 2 | 2.78% | 5.170 | 3.3% |
| w | 2 | 2.78% | 5.170 | 3.3% |
| . | 1 | 1.39% | 6.170 | 2.0% |
| c | 1 | 1.39% | 6.170 | 2.0% |
| f | 1 | 1.39% | 6.170 | 2.0% |
| g | 1 | 1.39% | 6.170 | 2.0% |
| j | 1 | 1.39% | 6.170 | 2.0% |
| l | 1 | 1.39% | 6.170 | 2.0% |
| m | 1 | 1.39% | 6.170 | 2.0% |
| p | 1 | 1.39% | 6.170 | 2.0% |
| q | 1 | 1.39% | 6.170 | 2.0% |
| s | 1 | 1.39% | 6.170 | 2.0% |
| T | 1 | 1.39% | 6.170 | 2.0% |
| x | 1 | 1.39% | 6.170 | 2.0% |
| y | 1 | 1.39% | 6.170 | 2.0% |
| z | 1 | 1.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
- Paste or type any text, password, token, or string into the input area, or click a sample to load one.
- Pick how a symbol is counted: characters (Unicode code points), bytes (UTF-8), or words.
- Read the Shannon entropy in bits per symbol, plus total entropy, maximum entropy, efficiency, and redundancy.
- Scan the frequency table to see each symbol's probability, bits, and share of the total information.
- 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
Password Entropy Calculator
Bits of entropy, possible combinations, and brute-force time at four attacker rates.
Open tool
TextLetter Frequency Counter
Per-character frequency table with percentages, bar chart, and English reference.
Open tool
DeveloperGPT Token Counter
Estimate GPT tokens, context window usage, and OpenAI API cost.
Open tool
CalculatorStandard Deviation Calculator
Sample and population SD, variance, quartiles, outliers, and step by step working.
Open tool