NFKD (Normalization Form KD) is the most thorough Unicode normalisation: it folds compatibility variants like ligatures and full-width letters and then fully decomposes precomposed characters into base letters plus combining marks. The result exposes every individual element, which is ideal for analysis, matching, and accent stripping. This tool applies NFKD and lists the code points before and after.
How it works
NFKD is a compatibility decomposition with no recomposition step:
fi -> f i (fi ligature → two separate letters)
A -> A (full-width A → ASCII A)
é -> e + ◌́ (precomposed U+00E9 → U+0065 U+0301)
² -> 2 (superscript two → digit 2)
ffi -> f f i (ffi ligature → three letters)
Combining marks are placed in canonical order so equivalent inputs always
produce the same output. Because compatibility variants are folded and
precomposed characters are split, the code point count usually grows. The tool
uses the engine’s native String.prototype.normalize("NFKD").
The four Unicode normalization forms compared
Unicode defines four forms; understanding when to choose NFKD requires knowing what the others do:
| Form | Canonical decomposition | Recomposition | Compatibility folding |
|---|---|---|---|
| NFC | Yes | Yes | No |
| NFD | Yes | No | No |
| NFKC | Yes | Yes | Yes |
| NFKD | Yes | No | Yes |
NFD decomposes é into e + combining accent but leaves the fi ligature
intact. NFKD does both: it decomposes é and also breaks the ligature into
f i. That makes NFKD the right choice when you need to catch all possible
representations of “fi” in a search, but the wrong choice when you need to
preserve the ligature for display purposes.
The canonical accent-stripping pipeline
NFKD is the standard first step for accent-insensitive text matching and normalization for databases. The typical pipeline is:
- Apply NFKD — decompose all precomposed characters and fold compatibility variants
- Filter — remove every code point in the combining diacritical marks block (U+0300–U+036F)
- The result is ASCII-safe base letters
For example:
café→ NFKD →café→ strip marks →cafefiancé→ NFKD →fiancé→ strip marks →fianceÅngström→ NFKD →Angström→ strip marks →Angstrom
This is widely used in search engines, username normalization, and database deduplication to prevent the same word in different encodings from appearing as separate entries.
When NFKD is lossy — and when that matters
NFKD discards style information that cannot be recovered:
- The
filigature becomes two letters — if a printed document relied on the ligature for typographic style, that is lost - Superscript
²becomes2— mathematical notation collapses - Full-width Latin characters (common in CJK documents) become ASCII equivalents
This is intentional for matching and search, but it means NFKD is not appropriate for storing or displaying text where those distinctions carry meaning. Use it for comparison and analysis; store the original form.
For the same folding but with marks recombined afterward, use NFKC — it gives
you cafe from café in a single precomposed form rather than leaving the
base+combining-mark pair.