Ithy

Text counter: UTF-8 bytes, Unicode points and characters

Count a piece of text in several precise ways. A visible character, a Unicode code point, a JavaScript string unit and a UTF-8 byte are different quantities. The tool labels each count and leaves the text unchanged.

Free to use, with no sign-in. Inputs and results stay in this page and are not sent with the form. Download a result before leaving; this tool does not save your work.

Enter text or data

Worked result

A😀é contains 7 UTF-8 bytes, 3 code points and 4 UTF-16 units.

  1. Encode the exact text as UTF-8 to count bytes.
  2. Iterate Unicode code points separately from JavaScript string units.
  3. Use grapheme segmentation when the browser provides it.

Count A, an emoji and an accented letter

This example uses the precomposed character é. The emoji lies outside the basic multilingual plane and needs two UTF-16 code units.

Text: A😀é
UTF-8 bytes: 1 + 4 + 2 = 7
Unicode code points: 3
UTF-16 code units: 1 + 2 + 1 = 4
Grapheme clusters: 3
Whitespace-separated words: 1
Lines: 1

A decomposed e followed by a combining acute accent can look like é while containing a different code-point sequence. No Unicode normalization is performed, so these differences remain visible.

Choose the count that matches the actual limit

UTF-8 bytes matter for byte-oriented storage and network limits. UTF-16 code units correspond to JavaScript string length. Code points distinguish Unicode scalar values, while grapheme clusters approximate user-perceived character boundaries.

Grapheme segmentation depends on browser Unicode support and can vary with versions. Whitespace-separated word count is deliberately a simple token count, not a language-specific linguistic analysis. Lines are counted by newline boundaries; an empty string has zero lines here.

UTF-8 bytes = byte length after UTF-8 encoding
UTF-16 units = JavaScript string length
Code points = number of Unicode code points
Words = nonempty whitespace-separated tokens

Input limits and common mistakes

Input is limited to 200,000 UTF-16 units. An unpaired surrogate is rejected rather than silently encoded as a replacement character. The output reports when grapheme segmentation is unavailable in the browser.

Line endings are counted as boundaries, with CRLF treated as one break. Spaces and trailing newlines still affect bytes and string length. Token count does not estimate model tokens, SMS segments, reading time or an application-specific quota.

Questions about text and utf-8 byte counter

Why can one emoji count as two JavaScript characters?

JavaScript length counts UTF-16 units. Some code points require a surrogate pair, so one code point occupies two units.

Is this an AI token counter?

No. Model tokenization depends on the tokenizer. This tool reports text and encoding counts only.

Does it normalize accented characters?

No. It preserves the entered sequence. Visually similar composed and decomposed text can have different byte and code-point counts.

Sources and verification

These references explain the formulas or formats. The worked examples above were created for this tool and checked against independent calculations or format round trips. AI-assisted development does not imply a named human expert review.

Published 2026-10-23. Examples are illustrations, not measurements of a service or claims about search rankings.

Related tools

Base64 text encoder and decoder

Encode Unicode text as standard or URL-safe Base64. Decode valid Base64 back into UTF-8 text with explicit padding and invalid-byte checks.

SHA-256 text checksum

Calculate a SHA-256 digest of UTF-8 text locally. Inspect byte count and compare a supplied hexadecimal checksum without uploading the input.

HTML escape and entity decoder

Escape ampersands, angle brackets and quotes, or decode common named and numeric HTML entities once. Render results as text without a live HTML preview.

All calculators and developer tools · Source-checked guides · How Ithy checks sources