Processed in your browser

Text Statistics

See the difference between user-perceived characters, Unicode code points, UTF-16 code units, words, lines, and encoded byte length. Emoji sequences and combining marks are grouped with Intl.Segmenter.

Processed in your browser
Unicode · Intl.Segmenter · UTF-8
0 / 1,000,000
Text statistics

Tool guide

What is Text Statistics?

Text Statistics reports grapheme clusters, Unicode code points, UTF-16 code units, words, lines, and UTF-8 bytes. This separates the characters a user perceives from the storage units a program counts. Emoji sequences, skin-tone modifiers, and combining marks are grouped as graphemes for interface limits, database fields, and encoding diagnostics. Common workflows include the following. Compare visible-character and byte limits for an input field. Understand why emoji or combined characters have different lengths. Measure words, lines, and UTF-8 size in multilingual copy. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.

When to use it

  • Compare visible-character and byte limits for an input field.
  • Understand why emoji or combined characters have different lengths.
  • Measure words, lines, and UTF-8 size in multilingual copy.

How to use it

  1. Paste or type text.
  2. Count it with Unicode-aware browser APIs.
  3. Compare grapheme, code point, word, line, and byte totals.
  4. Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.
  5. Review the output, status message, and documented limits; copy, download, or continue only after the result matches your expectation.

Runnable examples

The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.

Example 1

JSONLane version 1.5
Counts English, 中文, emoji 👍🏽, and the combining character é.
Inputs stay in this browser.

Example 2

First paragraph has words and the number 2026.
Second line has punctuation, tabs	and 🚀.
One final line.

Input rules

  • Input may contain any ordinary text.
  • Segmentation results depend on the browser's Unicode data.
  • Text beyond the displayed character limit is rejected.
  • Text input is counted before processing and is limited to 1,000,000 characters on this page; file modes apply the separate file limit shown in the workspace.
  • Word segmentation follows the browser's Unicode and locale data.

Output rules

  • Graphemes approximate user-perceived characters.
  • Code points, UTF-16 units, and UTF-8 bytes are counted separately.
  • Line counting recognizes LF, CRLF, and CR separators.
  • Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
  • Line count recognizes LF, CRLF, and CR separators.

Limitations and cautions

  • Word segmentation follows the browser's Unicode and locale data.
  • Line count recognizes LF, CRLF, and CR separators.
  • UTF-16 code units are included for developer comparison, not as a user-visible character count.

How your data is handled

Segmentation and byte encoding run locally; the text is not uploaded or written to browser storage.

FAQ

What is a grapheme?

It is a user-perceived character. One grapheme may contain multiple code points, such as an emoji plus skin-tone modifier.

How are bytes counted?

The text is encoded as UTF-8 with TextEncoder.

How are words identified?

Intl.Segmenter applies locale-aware word boundaries and counts word-like segments.

Why do grapheme and code-point counts differ?

One visible character can contain several code points, such as an emoji modifier or a letter plus combining mark.

Are Chinese words counted?

Word counts use Intl.Segmenter and the browser's Unicode data to identify word-like segments across writing systems.

What is the UTF-8 byte count useful for?

It helps estimate transport and storage limits, but it is not the same as a JavaScript string's UTF-16 length.

Updated: 2026-08-02