A character frequency map counts how often every distinct character appears in a piece of text and presents the result as a sorted table. It is a staple of classical cryptanalysis and a quick way to audit the makeup of any string.
How it works
The tool walks the text one code point at a time and tallies each character in a map, then sorts the results:
for each codePoint in text:
if ignoreWhitespace and char is whitespace: skip
if caseInsensitive: char = char.toLowerCase()
counts[char] += 1
sort rows by count desc, then by code point asc
Iterating by code point with a for...of loop means surrogate pairs such as
emoji are handled correctly. Whitespace characters are given readable labels so
their counts are visible.
Example and notes
In Mississippi, the character s and i each appear four times, so they top
the table, while M and p follow. For frequency analysis of a cipher, turn on
case-insensitive matching and ignore whitespace, then compare the top characters
against the expected English letter frequencies (e, t, a, o, i, n).