Grapheme Counter

Grapheme Counter

Count the characters a reader actually sees rather than the code units underneath. Grapheme clusters keep emoji, flags, and accented letters together, so the count differs from Unicode code points and JavaScript string length.

graphemes
unicode
emoji
Share this tool:
Quick Presets
Samples where emoji, flags, or accents change the countNeed emoji removed?
Input
Enter or paste your text below.
How it works: Segments the text into user-perceived characters with Intl.Segmenter and compares that count against Unicode code points and JavaScript UTF-16 units.

Was this tool helpful?

What is Grapheme Counter?

The Grapheme Counter reports how many characters a reader actually sees in a piece of text. Paste a string that contains emoji, flags, or accented letters and the tool returns four counts: grapheme clusters, Unicode code points, UTF-16 code units, and the code points that were joined into clusters. Segmentation uses the Intl.Segmenter API built into the browser. The comparison explains why the same text can report different lengths in different systems.

How does Grapheme Counter work?

A grapheme cluster is one user-perceived character. It can be a single letter, an emoji plus a skin tone modifier, a flag built from two regional indicators, or a letter plus a combining accent.

The tool segments the input with Intl.Segmenter using grapheme granularity, which applies the Unicode text segmentation rules. It also counts Unicode code points with Array.from and UTF-16 code units with the string length property. The gap between the code point count and the grapheme count is the number of code points that were joined into clusters.

Key Features

  • Grapheme cluster count from Intl.Segmenter
  • Unicode code point total
  • UTF-16 code unit total for JavaScript strings
  • Joined code point count for combined characters
  • Correct handling of emoji, flags, and accents
  • Works with mixed text and standalone emoji

Common Use Cases

When and why you might need this tool
  • Checking social media limits

    Platforms count emoji differently. Compare the visible character count with the UTF-16 length before posting.

  • Debugging string length in code

    Find out why a value that looks like five characters reports a length of eleven in JavaScript.

  • Preparing multilingual copy

    Check how many characters a translation really uses when it includes accents or non-Latin scripts.

  • Validating display names

    Confirm that a name with a flag or a combined emoji fits the character budget of a profile field.

  • Testing text truncation

    Measure cluster counts so a truncated headline does not cut an emoji in half.

How to Use This Tool

Step-by-step guide to get the best results
1

Paste the text

Enter the string you want to measure, including any emoji or accented letters.

2

Run the counter

Press Count Graphemes to segment the text into clusters.

3

Compare the four totals

Graphemes, code points, UTF-16 units, and joined code points appear side by side.

4

Copy the figures

Use the copy button in the result header to paste the counts into a bug report or test case.

5

Try another sample

Press New to clear the result and test a different string.

Pro Tips

  • 1

    A single family emoji can be seven code points and eleven UTF-16 units while remaining one grapheme.

  • 2

    Use the UTF-16 figure when you need the value that JavaScript reports for string length.

  • 3

    Use the grapheme figure when you need the number of characters a person sees on screen.

  • 4

    If the joined code point count is zero, the text contains only simple characters.

  • 5

    Compare a plain sentence with an emoji version to see how quickly the four totals diverge.

Frequently Asked Questions

What is a grapheme?

A grapheme is a single unit of written language as a reader perceives it. An emoji with a skin tone modifier is one grapheme even though it is built from two code points.

Why is the character count different from the string length?

JavaScript measures strings in UTF-16 code units, and many characters need two units. Emoji also add variation selectors and joiners. The grapheme count follows what is drawn on screen, so it is usually the smallest of the four totals.

How are emoji with skin tones counted?

A wave emoji with a skin tone modifier is one grapheme, two code points, and four UTF-16 units. The tool reports all three figures so you can see where each count comes from.

Does a flag emoji count as one character or two?

As one grapheme. A flag is built from two regional indicator code points that the segmenter joins into a single cluster, which is why it shows one grapheme but two code points and four UTF-16 units.

What happens if the browser has no Intl.Segmenter?

The tool falls back to counting code points, so the grapheme total matches the code point total. Current versions of Chrome, Edge, Firefox, and Safari all support Intl.Segmenter.