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, nX Required.
One or more Unicode values to be converted.
One or more Unicode values to be converted.
Return Value
Type
Description
A string A 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 (JavaScript 1997) feature.
It is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |