Favorites

JavaScript String.prototype.normalize() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
String.prototype.normalize()
JavaScript String Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The normalize() method converts a string to a standard Unicode form, so text that looks the same compares as equal.

Description

The normalize() method returns the Unicode normalization form of a string. The same visible text can be stored in different ways: "é" can be a single character or an "e" followed by a combining accent. Normalizing both strings to the same form, usually NFC, makes them compare as equal.

NFD splits accented characters apart, which can be used to strip accents by removing the combining marks.

The "K" forms, NFKC and NFKD, also replace compatibility characters with their plain equivalents, such as turning the ligature "fi" into "fi" and full-width letters into normal ones. That's useful when searching or comparing user input, but it changes how text looks, so don't use those forms on text you'll display or store as the user typed it.

Syntax

string.normalize()
string.normalize(form)

Parameters

  • formOptional. One of "NFC" (the default), "NFD", "NFKC" or "NFKD".

Return Value

The string in the requested Unicode normalization form.

Example

const a = 'caf\u00e9';
const b = 'cafe\u0301';
console.log(a === b);
console.log(a.normalize() === b.normalize());
console.log('Crème Brûlée'.normalize('NFD').replace(/\p{M}/gu, ''));

Browser Support

The following information will show you the current browser support for the String.prototype.normalize() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee