glyphcount

How we count

This page is the exact definition of every number glyphcount shows. If our count and another app's count disagree, this page is the arbiter.

Characters

  • Characters with spaces — every Unicode code point, including spaces, tabs, and newlines.
  • Characters without spaces — the same count with all whitespace (including non-breaking spaces) removed.
  • CJK characters — characters in the Han, Hiragana, and Katakana scripts, counted individually.

Four word-count engines

There is no single correct word count. Word processors made different decisions decades ago, and they still disagree. We implement four published rule sets and label each one:

EngineWhat it counts as a word
glyphcount baselineA run containing at least one letter, digit, underscore, or CJK character. Em dashes and hyphens do not split ("cat-and-dog" is 1). CJK characters count one per character.
Microsoft Word simulationWhitespace-separated tokens, except an en dash splits ("teacher–author" is 2). Standalone symbols (—, ©, #) count as words.
Google Docs simulationEm dashes and en dashes split, slashes split ("cat/dog" is 2), hyphens do not ("mother-in-law" is 1). URLs split on punctuation. Standalone em dash counts.
WordPress (wp_count_words)Runs of letters only, plus CJK per character. Numbers do not count ("123 456" is 0), and punctuation always splits ("don't" is 2).

Worked example

InputBaselineWordDocsWP
or—not1122
teacher–author1222
mother-in-law1113
cat/dog1122
3.141110
你好世界 test5555

Sentences, paragraphs, lines

  • Sentences — fragments ending in . ! ? (or 。!?); trailing quotes and brackets attach to their sentence.
  • Paragraphs — blocks separated by one or more blank lines; empty paragraphs do not count.
  • Lines — the number of Enter-separated rows; an empty box has 0 lines, not 1.

Reading time

Reading time uses the baseline word count at 200 words per minute (the adult average for silent English reading). Speaking time uses 130 wpm, the standard presentation pace.

Conversions

  • Binary / hex ↔ text — UTF-8 bytes, 8-bit or 2-hex-digit groups. Invalid input is rejected with the reason, never silently "repaired".
  • Binary ↔ decimal / octal / hex — arbitrary precision via BigInt; values past 2^53 convert exactly.
  • Base64 — standard RFC 4648 plus a URL-safe mode (- and _, no padding). Base64 is encoding, not encryption.
  • JWT — header and payload are Base64URL-decoded locally. Decoding is not validation; the signature is shown but never verified.

Known approximations

The Word and Docs engines reproduce published behavior on the cases in the worked-example table above, but both applications occasionally change their counters between versions. If you find an input where we diverge from the real app, that is a bug — email support@glyphcount.com with the text and both counts.