Favorites

JavaScript String.fromCharCode() Method

☕
Enjoying this site?

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

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

The String.fromCharCode() static method creates a string from one or more UTF-16 character codes.

Description

The String.fromCharCode() static method returns a string created from a sequence of UTF-16 code units. For characters above U+FFFF, such as emoji, use String.fromCodePoint(), which takes full code points.

Numbers are truncated to 16 bits, so values above 65535 wrap around rather than producing the character you might expect. That's why String.fromCodePoint(), which accepts the full Unicode range and throws a RangeError for invalid code points, is the safer choice for anything beyond basic text.

It's commonly used with spread syntax to turn an array of codes back into text, the reverse of mapping a string with charCodeAt(). For converting bytes of encoded text, such as UTF-8 data from a file, use TextDecoder instead.

Syntax

String.fromCharCode(num1, num2, ...)

Parameters

  • num1, num2, ...UTF-16 code units, numbers from 0 to 65535.

Return Value

A string made from the given code units.

Example

console.log(String.fromCharCode(72, 105));
console.log(String.fromCharCode(...[65, 66, 67]));
console.log(String.fromCodePoint(9731, 128512));

Browser Support

The following information will show you the current browser support for the String.fromCharCode() 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