Shannon Entropy Calculator
Measure Shannon entropy (H = −Σp·log2p) in bits per byte from 0 to 8 — above 7.5 suggests encrypted or compressed data, with a full byte-frequency table.
Or drop a file here to measure its raw bytes (any type)
Too short to classify: 44 bytes can read at most 5.46 bits per byte, and even random data seldom reaches 7.5 under about 512 bytes. At this length the figure cannot tell text from random data.
Byte frequency
| Byte | Char | Count |
|---|---|---|
| 0x20 | · | 8 |
| 0x6F | o | 4 |
| 0x65 | e | 3 |
| 0x68 | h | 2 |
| 0x72 | r | 2 |
| 0x75 | u | 2 |
| 0x2E | . | 1 |
| 0x54 | T | 1 |
| 0x61 | a | 1 |
| 0x62 | b | 1 |
| 0x63 | c | 1 |
| 0x64 | d | 1 |
| 0x66 | f | 1 |
| 0x67 | g | 1 |
| 0x69 | i | 1 |
| 0x6A | j | 1 |
| 0x6B | k | 1 |
| 0x6C | l | 1 |
| 0x6D | m | 1 |
| 0x6E | n | 1 |
| 0x70 | p | 1 |
| 0x71 | q | 1 |
| 0x73 | s | 1 |
| 0x74 | t | 1 |
| 0x76 | v | 1 |
| 0x77 | w | 1 |
| 0x78 | x | 1 |
| 0x79 | y | 1 |
| 0x7A | z | 1 |
Entropy per line or paragraph
Entropy of a distribution
What Shannon entropy measures
Shannon entropy quantifies how unpredictable a stream of bytes is. This tool counts how often each of the 256 possible byte values appears in your input and applies the information-theory formula H = −Σ p·log2(p) introduced by Claude Shannon to report the average information content in bits per byte. The scale runs from 0 to 8: input made of a single repeated byte scores 0 because it is perfectly predictable, while bytes spread evenly across all 256 values reach the maximum of 8. Text is UTF-8 encoded before it is measured, and a dropped file is analyzed as its raw bytes. The counts behind the figure are on the page too: a byte-frequency table listing every value that occurred with its hex code and how many times it appeared, the number of distinct byte values out of 256, and a Decimals field that sets how many places the bits-per-byte reading carries.
How to read the result
Entropy is a fast, format-agnostic way to guess what kind of data you are looking at. Ordinary prose, source code and structured formats such as JSON usually land between 3.5 and 6 bits per byte because a handful of characters dominate, while dense encodings like Base64 climb higher. Encrypted or compressed data has almost no statistical structure, so it packs close to the 8-bit ceiling — a reading above 7.5 bits per byte is a strong hint that a blob is ciphertext, a compressed archive or random key material rather than plain text. It is not a secret scanner, though: a key or token written as hex or Base64 can never reach 7.5, because hex holds at most 4 bits per character and Base64 about 6, so the tool names that ceiling instead — scanners compare a string against its own alphabet. And the 7.5 reading only applies to about half a kilobyte or more; shorter input is reported as too short to classify.
Frequently asked questions
What does bits per byte mean?
It is the average amount of unpredictable information carried by each byte, on a scale from 0 (every byte identical) to 8 (every byte value equally likely). Multiply it by the length in bytes to get the total entropy in bits.
Why does encrypted or compressed data score close to 8?
Encryption and compression both strip out the statistical patterns that make data predictable, so every byte value becomes roughly equally likely. That flat distribution is exactly what maximises Shannon entropy, which is why a reading above about 7.5 bits per byte often signals ciphertext or a compressed archive rather than plain text.
Is this the same as password entropy?
Not quite. Password-strength meters estimate entropy from the size of the character pool and the length you chose. This tool measures the actual byte-frequency entropy of the data you provide, which is the information-theory definition and is better suited to classifying files or opaque blobs.
Can I find where in a file the random-looking part is?
Open Rolling entropy: the file is measured window by window, drawn as a chart, and the regions that reach the high band are listed by byte range.
Can I measure each line separately, or a distribution I only have as counts?
Yes, in the folded sections under the result. Entropy per line or paragraph measures typed text piece by piece — pick Line or Paragraph under Measure each — and lists each piece with its number, its text, its bits per byte and its size, every piece measured on its own. Entropy of a distribution takes counts or probabilities separated by commas, spaces or line breaks and gives the entropy in bits beside what an even spread over that many outcomes would give. Every value is divided by the sum, and when probabilities do not add up the page says so.
Can I read it in nats or dits?
Yes. The Unit list beside Decimals switches every entropy figure on the page — the reading and its ceiling, the total, the verdict, the rolling-entropy peaks, each line and a distribution — between bits (log base 2), nats (natural log) and dits (log base 10). One bit is ln 2 ≈ 0.693 nats and log10 2 ≈ 0.301 dits. Everything is computed in bits and converted only for display, so the reading lands in the same band whatever the unit.