Text/String Inspector

String Inspector

Code points, encodings and invisible characters

Counts characters by Unicode code point, not by byte.
Text — input0 chars · 0 bytes
Properties appear as you type.

Text that looks identical can be entirely different underneath. A hyphen might be an en dash, a space might be non-breaking, an accented character might be one code point or a letter followed by a combining mark. When a comparison fails, a regular expression misses or a lookup returns nothing, the cause is usually something invisible.

This inspector breaks a string into its code points and shows the UTF-8 and UTF-16 bytes behind each, naming the characters you cannot see. It is the tool to reach for when a value copied from a document, a spreadsheet or a chat client refuses to match the one you typed by hand.

How to use it

  1. Paste the stringPaste rather than retype — retyping is what removes the very characters you are trying to find.
  2. Read the per-character breakdownEach entry shows the code point, the character name and the encoded bytes, so a zero-width space or a byte order mark becomes visible as a row of its own.
  3. Compare against a clean versionType the value by hand next to the pasted one. The row where the two diverge is the answer.

Frequently asked questions

Why does my string comparison fail when the text looks the same?

Because the bytes differ. Common culprits are a non-breaking space (U+00A0) instead of a normal one, smart quotes substituted by a word processor, an en dash instead of a hyphen, or a zero-width space pasted from a web page. All are invisible at a glance and all break equality.

What is Unicode normalisation and when do I need it?

The same visible character can be encoded in more than one way: é can be a single code point, or e followed by a combining acute accent. Normalisation rewrites text into one canonical form — NFC composes, NFD decomposes — so the two compare equal. Normalise before comparing or storing anything users typed, especially on macOS, which decomposes file names.

What is the difference between a code point and a character?

A code point is one Unicode value; a character as a person perceives it — a grapheme cluster — may be several. A flag emoji is two code points, an emoji with a skin tone modifier is two or more, and an accented letter may be one or two. String length in most languages counts code units, which is why an emoji can report a length of four.

What is a byte order mark and should I remove it?

U+FEFF at the start of a file, originally to signal endianness. In UTF-8 it serves no purpose but is added by some Windows tools. It is invisible, so it silently corrupts the first key of a CSV header, breaks JSON parsing and can appear as stray characters in output. Strip it unless something specifically requires it.

How can I find invisible characters in a large file?

Search for the specific code points rather than looking. Most editors support a regular expression search for a unicode escape, so searching for the non-breaking space or the zero-width space directly finds every occurrence. Inspecting a sample here first tells you which one to search for.

Related tools

Nothing left this tab. No request was made, no history was written. Text · String Inspector