Compare Unicode strings that look the same
Find the first code-point difference between two strings. Separate exact equality from NFC and NFKC equivalence without changing either input.
ON THIS PAGE
Start with the two original strings
A name copied from a document may look like the name in a form and still fail an equality check. Save both originals before trying a fix. Retyping the text can remove the very difference you need to find; a screenshot cannot preserve its encoded sequence.
Set Text A
Open Unicode Inspector and paste the first value into Input. This is Text A for the comparison.
Set Text B
Scroll to Compare two Unicode strings and paste the second value into Text B. Either field may be empty.
Compare
Choose Compare strings. Read Exact sequence first, then the normalized comparisons and first-difference table.
Decide
Use the original code points to identify the cause. If a transformation is appropriate, preview it separately in Unicode Normalizer before applying it.
Four pairs with different explanations
| Text A / Text B | Exact | After NFC | After NFKC | Meaning |
|---|---|---|---|---|
| é / e + U+0301 | Different | Equal | Equal | One precomposed letter versus a combining sequence. |
| A / A | Different | Different | Equal | Compatibility conversion removes the fullwidth distinction. |
| A SPACE B / A NBSP B | Different | Different | Equal | NFKC collapses this spacing distinction. That may change wrapping. |
| Latin a / Cyrillic а | Different | Different | Different | Similar shapes do not make the characters normalization-equivalent. |
ééFor the accent pair, the first difference is at code-point position 0 and UTF-16 offset 0: U+00E9 in Text A, U+0065 in Text B. The report stops at the first difference. It does not claim that every following character is wrong or compute an insertion/deletion alignment.
Read positions without splitting emoji
Positions start at zero. Code-point position counts each encoded value, while UTF-16 offset counts JavaScript string units. In 😀A versus 😀B, the differing letter is at code-point position 1 but UTF-16 offset 2. If one string ends first, the report says End of text and gives that input’s length as its offset.
What equal does and does not establish
Exact equality means the original sequences match. After NFC or After NFKC means only that those particular normalized results match. Neither result certifies a display name, detects all look-alike characters, guarantees matching font rendering, or determines a database’s collation. Case, punctuation and invisible characters still need attention.
Each field accepts up to 10,000 UTF-16 units. An isolated surrogate can be compared exactly, but its normalization result and UTF-8 byte count are unavailable. Grapheme counts require Intl.Segmenter. Browser text fields fold CRLF and CR to LF, so compare original file bytes outside a textarea when newline fidelity matters. Text is not uploaded, saved, or placed in the URL.
Sources and method
- Unicode Standard Annex #15: Unicode Normalization Forms — Canonical and compatibility equivalence.
- Unicode Technical Standard #39: Unicode Security Mechanisms — Confusable detection is a separate operation from normalization.
- MDN: String length — JavaScript length counts UTF-16 code units.
- WHATWG HTML: The textarea element — The textarea API value normalizes newlines.