Text FIELD NOTES · 3 MIN READ
Every Character Counts: Totals, Uniques, and Frequency Tables
One pass over a string yields three useful numbers — total characters, unique characters, and a frequency table ranked by count.
Characters are the atoms of text: every letter, digit, space, and punctuation mark your string is built from. A character counter is the microscope pointed at those atoms — one pass over the string produces a total, a count of distinct characters, and a frequency table ranked from most common to rarest.
Three numbers from one pass
The total is the raw length of the string: every character included, with spaces and newlines not exempt. The unique count is the number of distinct characters. The frequency table is built in a single loop — for each character, add one to its tally — then sorted so the most frequent characters lead. Run hello through it and you get a total of 5, four unique characters, and l leading with 2 while h, e, and o sit at 1 each:
"hello" → total 5, unique 4
l ×2
h ×1 e ×1 o ×1
Nothing is filtered out: punctuation, digits, and whitespace all appear in the table. That completeness is the point — a missing character is as diagnostic as a repeated one. The table is also a lens for invisible problems: a stray zero-width character or a curly quote that should have been straight shows up as an unexpected entry with a small count. When such an entry appears, the Zero Width Character Cleaner can hunt down the culprit.
Ties keep their first appearance
The sort is by count, descending, and ties are broken by first appearance in the text. Spell mississippi and the table reads i×4, s×4, p×2, m×1: i edges ahead of s not because 4 beats 4 but because an i shows up before the first s. That stable ordering means the same text always produces the same table — handy when you are comparing two versions of a document and want differences to mean something.
Frequency tables also have a distinguished history. Count letters instead of all characters and you are doing classic cryptanalysis: in English text, e leads at roughly 12.7% of letters, with t and a close behind, and a simple substitution cipher falls to whoever matches the ciphertext's most common symbols against that list. The Letter Frequency Counter runs that letters-only analysis, and What Word Frequency Reveals About Your Writing applies the same idea one level up, to whole words.
What counts as one character?
Two different answers coexist, and encoding is why. The total uses the string's length, which counts UTF-16 code units: one for nearly everything you type, but two for characters outside the Basic Multilingual Plane — many emoji and some rare scripts. The frequency table instead walks code points, so an emoji lands as a single entry. Paste 😀 hi and the total is 5 while the table shows four entries, the emoji counted once among them. Neither number is wrong; they measure different things, and How Text Encoding Works explains the machinery underneath.
Character counter vs word counter
Hard limits are almost always character limits. SMS messages break at 160 characters, meta descriptions fade around 155–160, and form fields count keystrokes, not words. Prose briefs — "500 words" — are word limits. So pick the tool by the constraint: the Word Counter for meaning-sized units, sentences, paragraphs, and reading time; the character counter for space-sized units, and for asking which characters dominate, not just how many there are.
Try it yourself
Paste mississippi into the Character Counter and read the table top to bottom: i and s tied at 4, p at 2, m at 1 — a tie-break you can verify by eye. Then paste a line with an emoji to watch the total and the table disagree pleasantly. For a letters-only league table of the same text, follow up with the Letter Frequency Counter, and keep the Word Counter alongside for the prose-level view.