๐ŸŽฐString Shannon Entropy Calculator

Shannon entropy and the theoretical byte floor

This figure is the entropy of a character distribution, not password strength. password123 scores 36.05 bits yet falls to a dictionary attack at once. Do not use it to judge passwords.

SymbolCountShareBits contributed

H = -sum p(c) * log2 p(c); total information is H times the symbol count, and the theoretical minimum is that total divided by 8 and rounded up. When every symbol is identical the floating point sum yields -0, so it is normalized to 0 for display. No prediction is made about what a real compressor would save.

You Might Also Need

How to use the string entropy calculator

Paste a string and the page reports how many bits of information an average symbol carries, how many bits the whole string holds, and the smallest number of bytes that could theoretically hold it. You can compute over characters or over UTF-8 bytes, and the table lists each symbol with its count and the bits it contributes. The sample buttons load hello world, password123 and aaaa so you can compare the three cases at once.

How the figure is computed

The page uses Shannon's definition, H = -sum p(c) * log2 p(c), unchanged. Total information is H times the symbol count, and the minimum byte count is the total divided by 8 and rounded up. When every symbol is identical the floating point sum lands on -0, so the value is normalized to 0 before it is shown. Checked against hello world at 2.8454 and password123 at 3.2776 in October 2026.

Limits worth knowing

Because entropy looks only at the distribution, it is not password strength. Dictionary words and common patterns can score well and still be guessed quickly. The figure is also a theoretical floor on information content, so it says nothing about how much gzip or brotli would actually shrink the data. The symbol table shows the 30 most frequent kinds. Everything is computed in your browser.

Frequently Asked Questions

Does high entropy mean a safe password?

No. Entropy only measures how evenly the symbols are spread. password123 scores 3.2776 bits per character and 36.05 bits in total, which looks respectable, yet it is a dictionary word and falls immediately. Strength has to be judged by how guessable a secret is.

Can the theoretical minimum really be 0 bytes?

Yes. For a string like aaaa every symbol is the same, the entropy is 0, and so is the minimum. That figure assumes the alphabet and the length are already known, while a real compressed file still carries a dictionary and a header.

What does this tool not do?

It does not predict what gzip or brotli would save, and it does not rate password strength. It computes the distribution entropy of your string and the theoretical floor on its information content.