Unicode normalize and compare
Normalize text to NFC, NFD, NFKC and NFKD and see which forms match.
Loading the tool…
What it does, how to use it, and questions
What it does
Unicode normalization folds characters into one of four forms: NFC and NFD for canonical composition/decomposition, NFKC and NFKD for compatibility forms used in identifiers.
Two strings that look the same can fail === when one is NFC and the other is NFD. This page shows all four forms and which pairs match.
How to use it
- Paste the text.
- Compare the four normalized outputs and the equality matrix.
- Copy the form your system expects (often NFC).
Things to watch for
- NFKC can change meaning (for example turning a superscript digit into a regular digit). Prefer NFC unless you know you need compatibility.
- Emoji ZWJ sequences can change appearance if you strip joiners elsewhere.
Questions
- Which form should I store?
- NFC is the usual default for text. Use NFKC only when matching identifiers that intentionally collapse compatibility characters.
- Why do two identical-looking strings differ?
- Accents can be one code point (composed) or a base letter plus a combining mark (decomposed). Normalization aligns them.
- Does this use String.normalize?
- Yes, the browser’s own
String.prototype.normalize. - Is the text uploaded?
- No.