Index of Coincidence Calculator
Compute Index of Coincidence (IC) of ciphertext to distinguish mono/polyalphabetic ciphers — classic cryptanalysis tool.
—
Telling monoalphabetic from polyalphabetic ciphertext
You have a block of ciphertext and no idea where to start. Caesar? Simple substitution? Vigenere with a five-letter key? Brute-forcing every option wastes hours, and the index of coincidence exists for exactly that first triage: a single number derived from letter counts that separates single-alphabet ciphers from ones that rotate through several alphabets.
IC is the probability that two letters drawn from the text without replacement are identical: the sum of nᵢ(nᵢ−1) divided by N(N−1). Monoalphabetic substitution only relabels letters and preserves the distribution, so it keeps the language IC, near 0.072 for Portuguese and 0.067 for English. A polyalphabetic key flattens frequencies and drags the value toward 1/26, that is 0.0385. The sample text loaded on the page scores 0.0675 across 79 letters.
IC needs volume: below about a hundred letters it swings too much to support any conclusion, and the ranges the page prints are guidance rather than a verdict. The tool computes one IC for the whole text; it does not test periods or estimate key length. To do that, slice the ciphertext into columns for candidate periods 2, 3, 4 and run each column through here: when the columns start reading near 0.07, you have found the period. Accented letters and the cedilla are discarded before counting, not folded.
Frequently asked questions
How much ciphertext do I need?
I got 0.045. What does that mean?
Does it work on Portuguese text with accents?
Related Tools
Kasiski Test for Vigenère
Find repeated trigrams in ciphertext, compute GCD of distances and suggest the Vigenère key length.
Vigenère Autokey Cipher Encoder and Decoder
Enciphers or deciphers text with the classic autokey variant, where the plaintext extends the keyword instead of repeating it. Letters A to Z only.
Vigenère Cipher
Encrypt and decrypt text with the polyalphabetic Vigenère cipher using a keyword. More robust than Caesar by using multiple shifts. Everything in your browser.
Frequency Analysis to Break Ciphers
Count letter, bigram and trigram frequencies in ciphertext and compare with Portuguese/English references.
Clear-Site-Data Header Builder
Build a Clear-Site-Data header (cache, cookies, storage, executionContexts) — useful on logout to wipe origin data.
JWT Secret Strength
Measures the strength of an HMAC JWT secret: byte length, approximate entropy and rating.