Get to know MDN better
The JavaScript exception "Invalid code point" occurs when NaN values, negative Integers (-1), non-Integers (5.4), or values larger than 0x10FFFF (1114111) are used with String.fromCodePoint().
String.fromCodePoint() throws this error when passed NaN values, negative Integers (-1), non-Integers (5.4), or values larger than 0x10FFFF (1114111).
A code point is a value in the Unicode codespace; that is, the range of integers from 0 to 0x10FFFF.
This page was last modified on Jul 8, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.