Unicode NFC vs NFD: what is the difference?

See why two strings can look identical while containing different code points.

6 min read•Updated

Quick answer: NFC uses precomposed characters when Unicode provides them, while NFD separates a base letter from its combining marks. They often render identically but can differ in code-point count, byte length, and direct string comparison.

Illustration of a Unicode character in composed and decomposed forms

One visible letter, two encodings

In NFC, Vietnamese “ế” is usually U+1EBF. In NFD it can be stored as e U+0065, combining circumflex U+0302, and combining acute U+0301. A browser renders the sequence as one visible letter.

This difference often appears when text moves between operating systems, keyboards, databases, and libraries. A byte-for-byte comparison can fail even when the words look the same.

Same appearance, different code points

Before

NFC: ế → U+1EBF

After

NFD: e + ◌̂ + ◌́ → U+0065 U+0302 U+0301

Which form should you use?

NFC is a practical default for web content, names, search fields, and general storage. NFD is useful when an application must inspect combining marks separately. NFKC and NFKD also fold compatibility characters, so they can change presentation meaning and require more care.

A safe repair workflow

Keep the original, inspect its code points, normalize a copy to NFC, and compare again. Normalize consistently when data enters a system rather than applying scattered fixes later. The Unicode normalizer on this site shows the code points before and after the change.

Frequently asked questions

Does Unicode normalization remove accents?

NFC and NFD preserve accents. They only change how the text is encoded.

Why does string length change?

NFD can use several code points for one visible grapheme, so code-point and UTF-16 lengths may increase.

References