Home / Text & Scheduling

String Inspector

Runs locally in your browser. Your input is not uploaded.

Counts
Characters (first 500 code points)
CharCode pointUTF-8UTF-16

A string can have several correct lengths depending on what you count. A person may see one character where Unicode stores multiple code points, JavaScript uses several UTF-16 code units, and UTF-8 uses still more bytes. This inspector shows those measurements together.

Use it to investigate emoji, accented text, invisible formatting characters, encoding limits, or an unexpected application length. The character table exposes the hexadecimal UTF-8 and UTF-16 representation of each displayed code point.

How to Use the String Inspector

Paste text and compare its human-facing and encoded measurements.

  1. Enter or paste content into Text to inspect.
  2. Read Counts for Characters (graphemes), Unicode code points, UTF-16 code units (JavaScript length), UTF-8 bytes, Words, Lines, Whitespace characters, and Non-ASCII code points.
  3. Review Characters (first 500 code points) and its Char, Code point, UTF-8, and UTF-16 columns.
  4. Check the status below the tables for an invisible formatting character warning.

Graphemes, Code Points, and JavaScript Length

A grapheme is a user-perceived character boundary. The inspector uses the browser's Intl.Segmenter with grapheme segmentation, so a base letter plus a combining accent can count as one grapheme. Many emoji sequences also contain multiple code points while appearing as one symbol.

A Unicode code point is a numbered value such as U+00E9 for é. The Unicode code points count iterates the string by code point, and the character table has one row per code point. That table is deliberately not one row per grapheme, so a combined emoji or accented sequence may occupy several rows.

JavaScript strings use UTF-16 code units. Most code points in the Basic Multilingual Plane use one unit, while supplementary code points such as many emoji use a surrogate pair and count as two. For that reason, UTF-16 code units (JavaScript length) matches JavaScript's .length, not necessarily what a reader considers the character count.

Normalization is not performed. The single code point é and the sequence e plus a combining acute accent can look alike but have different code point, UTF-16, and byte counts. Use the measurements to identify that difference rather than assuming visual equality means identical data.

UTF-8 Bytes, Words, Lines, and Whitespace

The UTF-8 bytes value is produced by encoding the complete string with the browser's TextEncoder. ASCII code points use one byte, while other code points commonly use two to four. The table prints each code point's bytes as uppercase hexadecimal pairs separated by spaces.

Word counting uses Intl.Segmenter with word granularity and includes segments the browser reports as word-like. This is more language-aware than simply splitting on spaces, but results can depend on the runtime's segmentation data and locale. It is not a grammar checker or a substitute for the counting rules of a specific publishing platform.

Line counting recognizes line feed, carriage return, and CRLF boundaries. Non-empty text has at least one line; an empty string reports zero. Whitespace characters counts JavaScript \s matches, which can include tabs, line breaks, and several Unicode space characters, not only ordinary spaces.

Non-ASCII code points counts code points above U+007F. That is useful for spotting international text or typographic punctuation, but non-ASCII does not mean invalid or unsafe. Unicode is expected in modern text systems.

Reading the Code Point Table and Warnings

The table is limited to the first 500 code points so a large paste does not create an unbounded number of rows. Counts still describe the entire input. Each row shows the code point as U+ followed by at least four hexadecimal digits, its UTF-8 bytes, and its UTF-16 code units.

Some hard-to-see values receive visible labels. An ordinary space appears as ␠, a tab as ⇥, a newline as ↵, and a carriage return as ␍. The table also labels ZWSP, ZWNJ, ZWJ, NBSP, and BOM; combining marks are drawn with a dotted circle so their position can be seen.

The warning counts a defined set of invisible formatting characters: selected zero-width and direction marks, Unicode line and paragraph separators, some directional controls, word-joiner-related controls, the byte order mark, and soft hyphen. It reports only the total, while the table helps locate values that fall within its first 500 code points.

This is not a comprehensive Unicode security scanner. It does not detect every confusable character, mixed-script identifier, normalization issue, or bidirectional-text attack. Treat the warning as a focused diagnostic, not a declaration that unflagged text is safe.

Debugging Text Safely in the Browser

Inspection runs locally in your browser, and the input is not uploaded for processing. This reduces unnecessary exposure when checking application strings, but secrets, access tokens, and personal records should still be replaced with representative samples whenever possible.

Invisible controls and lookalike characters can make source code, domain names, and account identifiers misleading. Compare code points when text has an unexpected visual order or fails an equality check. Do not remove a character automatically: zero-width joiners and combining marks can be required for correct writing or emoji presentation.

Byte limits also need the correct measurement. A database column, network protocol, or API may limit UTF-8 bytes, while a frontend counter may use graphemes or UTF-16 units. Confirm the receiving system's contract before truncating text, because cutting inside an encoded sequence can corrupt it.

For byte-by-byte inspection or conversion, use the ASCII to hex converter. To compare two visually similar strings, use the text diff checker alongside this code point view.

Frequently Asked Questions

Why are graphemes and code points different?

A visible character can be assembled from several Unicode code points, such as a letter followed by a combining mark or an emoji joined into a sequence. Grapheme segmentation groups those code points into user-perceived characters. The code point count measures the underlying values instead.

Why does JavaScript length count an emoji as two?

JavaScript's string length counts UTF-16 code units. A supplementary Unicode code point is represented by two units called a surrogate pair, so many emoji add two to .length. A multi-code-point emoji can add even more units while remaining one grapheme.

Does the table inspect the entire string?

The numeric counts cover the entire input, but the character table displays only the first 500 code points. This keeps the page manageable for large strings. A warning can count invisible formatting characters beyond that table limit even though their rows are not shown.

What does the invisible character warning mean?

It means the input contains one or more characters from the tool's focused list of zero-width, direction, separator, BOM, or soft-hyphen code points. Some have legitimate uses, so the warning is not proof of malicious text. Inspect the source and expected language before removing them.

Are UTF-8 bytes the same as file size?

They are the size of this text after UTF-8 encoding. A saved file may also contain a byte order mark, metadata, a different character encoding, or surrounding syntax that changes its total size. The tool does not read a file container; it measures the textarea string.

References: Unicode Standard Annex #29: Text Segmentation · WHATWG Encoding Standard: UTF-8.