Shannon Entropy Calculator

This tool computes Shannon entropy right in your browser — the text never leaves the page. Three alphabets are available: Unicode characters, UTF-8 bytes and words. Besides the whole-text summary there is a per-line mode: lines with unusually high entropy get highlighted — a handy way to spot tokens, keys and passwords that leaked into logs and config files.

What Shannon entropy is. Entropy H = −Σ pᵢ·log₂pᵢ is the average amount of information (in bits) per symbol of a message. The more diverse and uniform the symbol distribution, the higher the entropy: a string of identical letters scores zero, a uniform alphabet of N symbols scores log₂N. Meaningful text is redundant and yields 4–4.5 bits per character, while random data (keys, tokens, compressed files) approaches the maximum — which is exactly why entropy works for secret scanning.

Units:

Text summary

Entropy H:
Alphabet size:
Normalized entropy H/H₍max₎:
Redundancy:
Total units:
Information H×N:
Theoretical compression limit:

Reference scale (bits/unit)

Frequency table

Unit Count Probability Contribution, bits

Per-line analysis

Sort:
# Entropy Length Content

Free online Shannon entropy calculator. Computes text entropy over Unicode characters, UTF-8 bytes or words, and reports alphabet size, normalized entropy, redundancy and the theoretical compression limit. The frequency table breaks down each symbol's contribution to the total.

The per-line mode is built for secret scanning: lines of a log or config file whose entropy exceeds an adjustable threshold get highlighted as candidates — that is how accidentally committed API keys, tokens and passwords are found. The same technique powers secret scanners like truffleHog and gitleaks.

Everything runs entirely in your browser: the text is never sent to a server, so the tool is safe to use with private data. A reference scale of typical values is provided for comparison — from meaningful text (~4 bits per character) to random bytes (8 bits).