String.normalize([form]) Last updated: 02. Jun 2026

Returns the Unicode Normalization Form of the string, allowing comparison of strings that may use different code-point sequences for the same characters.

See also: MDN Web Docs: String.prototype.normalize()

Parameters

Name Type Description
form (optional) string

The Unicode Normalization Form to use. One of "NFC" (default), "NFD", "NFKC" or "NFKD".

Returns

A new string containing the Unicode Normalization Form of the given string.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    let str = "\u00C5"; // Å as a single code point
    let normalized = str.normalize("NFD"); // decomposed form
    write(`Length NFC: ${str.length}, length NFD: ${normalized.length}`);
}#

Output

The #JS code above produces the output shown below:
Length NFC: 1, length NFD: 2