Count your text
Type or paste text below, then press the count button. The totals do not update while you type, so press it again after you edit.
What it measures
This counter is for anyone working to a stated length: a 500-word essay, a 160-character message, a form field with a hard cap. It answers one question — how long is this text under one documented rule — and it shows the rule, so you can tell whether it matches the one your marker, editor or platform uses. It runs entirely in your browser and sends nothing to a server.
The exact counting rules
The script does three things. It trims whitespace from both ends of your text, splits what is left on runs of whitespace, and counts the pieces. Separately it takes the length of the untrimmed text.
- What separates words. Any run of whitespace, of any length, separates two words: a space, a tab, a line break, a no-break space, or an ideographic space. Two spaces between words still produce one split, not an empty word.
-
What counts as one word. Anything with no whitespace
in it. So
well-known,and/or,don't,2026,50%anda@b.comare each one word — and a dash with spaces around it is also one word. - Empty input. If the text is empty, or contains only whitespace, the word count is 0 rather than 1.
- Spaces and line breaks are characters. The character total is the length of the raw text box value, so every space, tab and line break is included — including the spaces before the first word and after the last one, which the word count ignores.
- Characters are UTF-16 code units. That is what JavaScript reports as a string's length. Ordinary Latin, Greek, Cyrillic, Arabic, Hebrew and most CJK characters count as 1 each. Characters outside the first 65,536 code points count as 2 — most emoji, for example. An emoji built from several joined parts counts every part: 👍 is 2, and 👨👩👧 is 8, because it is three people joined by two invisible joiner characters.
-
Accents depend on how they were typed. If
éarrives as the single precomposed character it counts as 1. If it arrives as a plainefollowed by a combining acute accent — which some keyboards and some macOS text produce — it counts as 2, even though it looks identical. Nothing is normalised first. - No rounding and no cap. Both totals are whole numbers printed as they are, and the code sets no maximum text length.
Worked examples
In the first column ␣ marks a space. These results come
from the counting function itself.
| Input | Words | Characters | Why |
|---|---|---|---|
hello | 1 | 5 | One piece, five letters. |
␣hello␣ | 1 | 7 | The outer spaces are trimmed before splitting, but they are still part of the text's length. |
hello␣␣world | 2 | 12 | A run of two spaces is one separator, so there is no empty third word. |
␣␣␣ | 0 | 3 | Whitespace-only text gives zero words, not one. |
well-known | 1 | 10 | The hyphen is not whitespace, so the compound stays whole. |
a, a line break, then b | 2 | 3 | The line break separates the words and also counts as one character. |
👍 | 1 | 2 | An edge case: one visible glyph, two UTF-16 code units. |
Length limits worth knowing
Only a few length limits are genuinely fixed. These are defined in the GSM specifications for text messages; the search-result figure is a display convention, not a rule.
| Where | Limit | Notes |
|---|---|---|
| One SMS segment, GSM 7-bit alphabet | 160 characters | The default alphabet covers basic Latin letters, digits and common punctuation. |
| One SMS segment, 16-bit alphabet | 70 characters | A single emoji or an accented letter outside the 7-bit alphabet switches the whole message to this mode. |
| Each part of a multi-part SMS | 153 or 67 characters | Joining information takes space from every part, so two segments hold 306 characters, not 320. |
| HTML meta description | No fixed limit | Search engines shorten what they display. Around 150–160 characters is the usual point at which a description is cut in desktop results. |
This tool counts UTF-16 code units, not GSM septets, so treat the SMS rows as a guide and check the final message in the app that sends it. Other platform caps change often enough that the limit printed beside the field you are typing into beats any published number.
Common mistakes
- Assuming a character limit excludes spaces. Most do include them, and this counter always does. If a form rejects text that looks short enough, spaces are the usual reason.
- Pasting from a word processor and expecting the same word count. Different programs disagree about hyphenated compounds, numbers, footnotes, captions and headings.
- Counting a draft that still has double spaces, a trailing blank line or an invisible no-break space pasted from a web page.
- Editing the text and reading the old numbers. Press the count button again; nothing recalculates on its own.
- Treating emoji as one character each when planning a message length. They almost never are.
Limits
It reports two numbers and nothing else. There is no sentence, paragraph, line or unique-word count, no characters-without-spaces figure, no reading-time estimate, and no spelling, grammar or style check. It does not detect the language of the text or adjust its rules for it.
It cannot count words in writing systems that do not put spaces
between words, such as Chinese, Japanese and Thai; a whole run of such
text counts as one word, although the character total is still
correct. The copy button uses the browser clipboard API, which some
browsers block; if that happens you get a message asking you to copy
manually. The download button saves the box contents as a UTF-8 plain
text file named text.txt.
Questions
How do I get the character count without spaces?
Subtract the whitespace. For text with exactly one space between words and no leading, trailing or double spaces, that is characters minus (words − 1). For anything messier, remove the spaces in a text editor and count again.
My essay tool says 498 words and this says 501. Which is right?
Both, under their own rules. Use whichever tool your marker or platform uses, and leave a margin of a few percent. The reasons the numbers diverge are set out in how word counts differ.
Is there a maximum amount of text?
The code sets none. Very large documents — hundreds of thousands of words — may make the browser slow to paste and redraw, which is a browser limit rather than a rule in the tool.
Does a line break count as one character or two?
One. A text box reports line breaks as a single newline character even on Windows, where files on disk normally use two.
Is my text uploaded anywhere?
No. The counting, clearing, copying and download code all run on your device. Nothing in it contacts a server with your text. The site itself may use ordinary hosting logs; see the privacy policy.
Related tools
Reviewed October 1, 2026. Calculation methods and corrections
