Entropy and Information Calculator
Gives Shannon entropy of a distribution or a text, KL divergence with Jensen-Shannon and cross-entropy, and mutual information from a table of counts, in bits, nats or hartleys.
- Free
- No sign-up
- Works on any device
About Entropy and Information Calculator
Entropy measures uncertainty: the average number of bits needed to say which outcome happened. Enter probabilities or counts and get Shannon entropy, its maximum, the efficiency and the perplexity. Paste a text and it counts characters or words, so abracadabra has 2.04 bits per letter. KL divergence compares a distribution P with a model Q and also gives the Jensen-Shannon divergence and the cross-entropy. Mutual information takes a table of joint counts and tells how much knowing one variable reduces uncertainty about the other. Choose bits, nats or hartleys.
How to use Entropy and Information Calculator
- Choose distribution, text, KL divergence or mutual information and the unit.
- Enter probabilities or counts, the text, the two distributions, or the table of joint counts.
- Read the entropy values and the table of contributions.
Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
Also known as
Frequently asked questions
Do I have to type probabilities that add up to 1?
No. Any non-negative numbers are accepted and scaled to add up to 1, so raw counts work. A line of 5, 2, 1, 1, 2 is read as five out of eleven for the first outcome and so on.
Why is the KL divergence infinite?
P gives some outcome a positive probability that Q gives zero. A code built for Q cannot represent that outcome at all, so the cost is unlimited. Smooth Q slightly if that is not intended.
Is text entropy the same as the compressed size?
It is a lower limit for coding each character independently. Real compressors use context, so they often do better, and short texts make the estimate unreliable.
Is Entropy and Information Calculator free?
Yes. Entropy and Information Calculator on Toolipedia is free to use, with no sign-up and no watermark.
Is it safe to use?
Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.
Does it work on my phone?
Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.
Do I need an account?
No. Just open the page and use the tool. There's no sign-up and no email needed.