Inspect Unicode · browser-local
Character Counter
Count text with several length models at once. GlyphSift reports user-perceived characters (graphemes) alongside words, lines, code points, UTF-16 units, and UTF-8 bytes so you can match the count a destination actually uses. It also shows code points minus graphemes, which reveals combining marks and joined emoji.
Works on up to 5,000 characters and 20,000 code points per field (at most 64 code points per character), processed in your browser.
Output
Good fit
Use this tool when
- You are checking text against a field character limit.
- You want words and lines in addition to characters.
- You need to know which length model a platform counts.
Keep the original
Avoid it when
- You only need the raw byte size.
- You need per-character diagnostics instead of totals.
- The destination documents a counting model you can match directly.
Reviewed truth vectors
Examples that expose the edge cases
The quick brown fox.20 characters · 4 words · 1 lineCharacters count user-perceived graphemes.
Line 1
Line 213 characters · 4 words · 2 linesLine breaks are counted as lines.
👨👩👧👦1 character · 7 code points · 11 UTF-16 unitsA family emoji is one grapheme built from four people joined by three zero-width joiners.
Transparent implementation
How it works
- 01
Segment user-perceived characters with Intl.Segmenter (UAX #29). If the browser lacks it, an approximate fallback is used and labelled.
- 02
Split on whitespace for words and on line breaks for lines.
- 03
Report code points, UTF-16 units, and UTF-8 bytes, plus code points minus graphemes.
Known limitations
What the result cannot promise
Word counting splits on whitespace and may differ from editorial rules.
A platform may document characters without defining its model.
Counts exclude transport and escaping overhead.
Questions before copying
Frequently asked questions
Which number matches a platform limit?
It depends on the platform. Many count code points or graphemes; compare the models shown here against the field's documented rule.
How are emoji counted?
A single emoji is one character (grapheme) but can be several code points and bytes, all shown separately.
How are words counted?
Words are runs of non-whitespace separated by spaces, tabs, or line breaks.
Why does String length differ from the character count?
JavaScript String length counts UTF-16 units. Emoji outside the Basic Multilingual Plane take two units each, so the UTF-16 figure is shown separately from graphemes.
Testing and sources
How this tool is tested
Automated evidence
- Tool-contract & coverage suiteShared suite · 37 cases across all tools it covers
tests/tools-30.test.mjs mirrors the ToolRunner dispatch and asserts every registered engineId returns the contracted output shape, plus a coverage guard: every style keeps one output character per input character with unmapped characters passed through in place, and strikethrough, zalgo and upside-down never drop or split a grapheme cluster.
Run in: node --test after a production build (vinext build) - Rendered-HTML suiteShared suite · 26 cases across all tools it covers
tests/rendered-html.test.mjs renders the deployed server bundle and asserts the Unicode-version manifest and each wave's tool markup are present in the server-rendered HTML.
Run in: node --test against the built dist/server bundle - Unicode inspection suiteShared suite · 21 cases across all tools it covers
tests/unicode-inspection.test.mjs verifies grapheme/code-point/byte counting and hidden-control detection using explicit \u escapes for combining and bidirectional characters.
Run in: node --test against the runtime's Unicode data - Compatibility risk suiteShared suite · 13 cases across all tools it covers
tests/compatibility.test.mjs checks that bidirectional controls, invisible characters, mixed scripts, and NFKC-changing input raise the documented risk status, and that safe-text stripping preserves ordinary content.
Run in: node --test, deterministic analyzer
Standards this tool follows
- UTS #39: Unicode Security Mechanisms
Confusable and mixed-script detection methodology.
- UAX #9: Unicode Bidirectional Algorithm
Bidirectional control characters flagged during inspection.
- UAX #15: Unicode Normalization Forms
NFC/NFKC normalization comparisons.
- RFC 3629: UTF-8
Byte-length counting for the UTF-8 encoding.