Unicode Normalizer for NFC, NFD, NFKC and NFKD

Unicode normalizer converts text to one of the four standard normalization forms and shows how the code points, UTF-16 units and UTF-8 bytes change.

Compares all four Unicode normalization forms and produces the one you pick. Runs in this page with the browser's built-in String.prototype.normalize. Text is accepted up to 50,000 characters.

Files and pasted text are read in this page; nothing is uploaded and no account is needed. This page also loads analytics scripts, so avoid confidential text.

Output form

NFKC and NFKD are compatibility forms. They fold distinct characters together: ① becomes 1, fi becomes fi, ½ becomes 1⁄2, ㎡ becomes m2. Never use them on identifiers, passwords, file names or anything you must compare exactly.

NFC and NFD also change strings: U+212A KELVIN SIGN becomes K, and combining marks are canonically reordered, so U+0061 with U+0315 U+0300 becomes U+00E0 with U+0315 under NFC.

Next: inspect invisible characters, count characters, change letter case or collapse extra spaces.

Why normalize Unicode text?

Two strings can look identical

An e followed by a combining acute accent and a single e with acute are drawn the same but are different sequences. A byte comparison says they differ, and a database unique index can store both.

Four forms, four jobs

NFC and NFD keep the meaning and change only how it is encoded. NFKC and NFKD also fold compatibility variants such as circled digits, which helps matching and is unsafe for text you display.

Code points, not guesses

Each form is shown as a code point sequence with its count and byte size, so you can see which characters changed instead of trusting a visual diff.

How the four normalization forms differ

Unicode defines canonical equivalence and compatibility equivalence. NFC composes characters that have a canonical decomposition and NFD decomposes them fully. Both are reversible, and text that is canonically equivalent compares equal after either form. NFKC and NFKD apply compatibility mappings first and then compose or decompose, which can replace a character with one of different width or meaning.

The worked example above shows the difference. An e with a combining acute, the Kelvin sign, a circled digit, an fi ligature, a vulgar fraction and a dotted long s with a dot below all sit in one string. NFC already turns the Kelvin sign into a plain K, because that is canonical equivalence, and it composes the accented letters. The compatibility forms go further and replace the circled digit, the ligature and the fraction, which is the loss the page warns about.

Forms, counts and limits

  • InputCode point count, UTF-16 unit count and UTF-8 byte count of the text as pasted, before any conversion.
  • NFC and NFDCanonical forms. Reversible, so normalizing a result again in the same form leaves it unchanged. They still change the string: a Kelvin sign becomes a K and combining marks are reordered.
  • NFKC and NFKDCompatibility forms. Not reversible, and they may replace a character with a plainer one, so they are not for text you intend to display.
  • Code point listWritten as U+ followed by at least four hexadecimal digits, one row per distinct code point, with a count of how often it occurs. A surrogate pair is one row, because it is one code point.
  • Lone surrogatesNormalization preserves an unpaired surrogate, but UTF-8 cannot encode one, so the byte count shows n/a and export is blocked rather than writing a number that does not match the file.
  • Accents stay intactNFC and NFD never remove an accent. They change whether the mark is stored as part of one character or as a separate combining code point. A page that promises to strip diacritics is doing a different job.
  • LimitsText is accepted up to 50,000 characters, counted in code points, so an emoji counts once. The comparison runs on the action, and the code point list shows the first 200 distinct code points of a longer result.

Common Use Cases

Compare two pasted strings

Check whether a search term and a stored value differ only in normalization before debugging a matcher.

Prepare text for an index

Normalize imported labels to one form so a lookup does not depend on how the source encoded an accent.

See what a fold destroys

Compare NFKC with the input before folding a compatibility character that carries meaning, such as a superscript or a circled number.

How to compare Unicode normalization forms

1

Paste the text

Paste the string you want to inspect, including characters that look identical to others.

2

Read the input counts

Check the code point, UTF-16 and UTF-8 counts before any conversion.

3

Compare the four forms

Look for forms whose text, counts or byte size differ from the input.

4

Copy the chosen form

Pick a form and copy or download that output, then read the compatibility warning if you used NFKC or NFKD.

Counts and warnings, not guesses

Byte sizes

Code point, UTF-16 and UTF-8 counts sit next to each form, so a shorter encoding is visible rather than assumed.

Named forms

Every result is labelled NFC, NFD, NFKC or NFKD, and the page never substitutes a different form for the one you chose.

Loss warning

The compatibility forms carry a visible warning about changed meaning, and the tool does not strip accents, change case or repair mojibake.

First difference named

The readout points at the first position where the chosen form differs from your input, instead of a vague count of changed characters.

Before you normalize a whole dataset

  • •Normalize at the boundary: Normalize when text enters a system and again when comparing, so older records are never assumed clean.
  • •NFC for stored text: NFC is the form most often used for text that is stored and displayed, while NFD helps when you need base letters and marks kept apart.
  • •Not a security filter: Normalization does not detect lookalike characters used in spoofing. That needs a separate confusable check.
  • •Check the byte count: Two encodings of the same word can differ by a byte or more per accented letter, which matters for a database column limit measured in bytes.

Compare and convert Unicode forms

Paste text above and compare all four forms with their code points and byte counts.

Copy the form you need, keeping the compatibility warning in mind when you choose NFKC or NFKD.

Related tools

Frequently Asked Questions

What is the difference between NFC and NFD?

NFC composes a base letter and its mark into one code point where Unicode allows it. NFD keeps them apart. The two forms are canonically equivalent, so the text reads the same.

Why does text look the same but count as different?

A composed letter and a letter plus a combining mark can look identical and still be different code point sequences, so a byte comparison treats them as different strings.

Does NFKC or NFKD change meaning?

It can. Compatibility forms fold characters such as circled digits, ligatures, fractions and full-width letters into plainer ones, which is useful for matching and wrong for text you intend to display.

Is normalizing the same as removing accents?

No. Normalization never deletes a diacritic. Removing accents is a separate operation that discards information, and this page does not do it.

Why is the byte count missing for my text?

An unpaired surrogate cannot be stored as UTF-8. The page flags it and blocks export instead of printing a byte count that would not match the downloaded file.