JavaScript String.fromCharCode()

Examples

How to convert Unicode values to characters:

let char = String.fromCharCode(65);
Try it Yourself »
let text = String.fromCharCode(72, 69, 76, 76, 79);
Try it Yourself »

Description

The String.fromCharCode() method converts Unicode values to characters.

The String.fromCharCode() is a static method of the String object.

The syntax is always String.fromCharCode().

You cannot use myString.fromCharCode().


Syntax

String.fromCharCode(n1, n2, ..., nX)

Parameters

Parameters Description
n1, n2, nXRequired.
One or more Unicode values to be converted.

Return Value

Type Description
A stringA string representing the unicode character(s).


Tip

For a list of all Unicode values, please study our Complete Unicode Reference.


Browser Support

String.fromCharCode() is an ECMAScript1 (ES1) feature.

ES1 (JavaScript 1997) is fully supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes Yes

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.