Text Tools
How to Count Words, Characters and Reading Time Accurately
Count words, characters, sentences, lines and reading time as you type, and learn the edge cases that make accurate counting harder than it looks.
Try the toolWord & Character Counter →The problem: limits are everywhere
Meta descriptions get truncated around 155 characters. A tweet caps at 280. An SMS message splits at 160. A "2,000-word article" brief is a real deliverable, and your essay has a word target. In every one of these cases you need a fast, accurate count, and the number your word processor shows does not always match the number the other system will enforce.
How counting works, and where it gets tricky
Counting sounds trivial: split on spaces and count the pieces. In practice, each metric hides an edge case.
Words
The standard approach is to trim the text, split on runs of whitespace, and count non-empty tokens:
const text = "Hello, world! This is a test.";
const words = text.trim().split(/\s+/).filter(Boolean).length; // 6
Collapsing \s+ into a single delimiter is what stops double spaces and line breaks from inflating the count.
Characters
Character counts come in two flavors, with and without spaces, and both can disagree with what you expect once emoji or accents appear:
"café".length; // 4 or 5, depending on how é is encoded
"😀".length; // 2 — one emoji, two UTF-16 code units
[..."😀"].length; // 1 — spread iterates code points
JavaScript's .length counts UTF-16 code units, not human-visible characters. For anything user-facing, iterate with the spread operator or Intl.Segmenter to count actual glyphs.
Sentences, lines and reading time
const sentences = text.split(/[.!?]+/).filter(s => s.trim()).length;
const lines = text.split(/\r\n|\r|\n/).length;
const minutes = Math.ceil(words / 200); // about 200 words per minute
Reading time is an estimate: 200 to 250 words per minute is the usual range for adult silent reading.
A practical walkthrough
Suppose you are writing a meta description and need it under 155 characters. Paste your draft into the Word & Character Counter and watch the character count update as you trim. Because it counts live as you type, you can tighten a sentence and immediately see whether you are under the limit, with no submit button and no round trip to a server.
Common pitfalls
- Emoji and flags. A flag emoji is several code points glued together; naive length counts will overcount. Segment by grapheme if precision matters.
- CJK text. Chinese, Japanese and Korean often are not space-separated, so whitespace splitting undercounts words dramatically. Character count is the more meaningful metric there.
- Hyphenated and contracted words. Is
state-of-the-artone word or four? Isdon'tone? Pick a rule and apply it consistently; most counters treat both as single tokens. - Trailing whitespace. A stray newline at the end of a paste can add a phantom line. Trimming first avoids it.
Related tools
If you are counting to hit an SEO limit, pair this with the Meta Tag Generator to build the final tags. And for cleaning up messy pastes before counting, Remove Line Breaks flattens hard-wrapped text into single lines.
Conclusion
A word counter is only as trustworthy as its handling of the edge cases: Unicode, whitespace, and sentence boundaries. Knowing where the naive approach breaks lets you trust the number. The Word & Character Counter tracks words, characters, sentences, lines and reading time live in your browser, with nothing sent anywhere.