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.

38 graphemes38 code points38 bytes

Live result

Output

38Characters (graphemes)
7Words (whitespace-separated)
2Lines
38Code points
38UTF-16 units
38UTF-8 bytes
0Code points minus graphemes

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.
01

Reviewed truth vectors

Examples that expose the edge cases

InputThe quick brown fox.
Output20 characters · 4 words · 1 line

Characters count user-perceived graphemes.

InputLine 1 Line 2
Output13 characters · 4 words · 2 lines

Line breaks are counted as lines.

Input👨‍👩‍👧‍👦
Output1 character · 7 code points · 11 UTF-16 units

A family emoji is one grapheme built from four people joined by three zero-width joiners.

02

Transparent implementation

How it works

  1. 01

    Segment user-perceived characters with Intl.Segmenter (UAX #29). If the browser lacks it, an approximate fallback is used and labelled.

  2. 02

    Split on whitespace for words and on line breaks for lines.

  3. 03

    Report code points, UTF-16 units, and UTF-8 bytes, plus code points minus graphemes.

03

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.

04

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.

05

Testing and sources

How this tool is tested

GlyphSift Editorial — Text-engine notes written and reviewed by Hommer Zhao, Founder & General Manager

GlyphSift Editorial is the site's writing and review process, led by Hommer Zhao, who is accountable for every tool page and correction. Each tool's examples are written against real Unicode edge cases and checked against the engine before the page is published.

Each tool page is reviewed against the same six input classes the engine is tested with — ASCII, emoji, combining marks, non-Latin scripts, empty input, and 5,000-grapheme input — and cannot become eligible if it is only a parameter variation of another page.

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