English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript String fromCharCode() Method

 JavaScript String Object

fromCharCode()The method returns a string encoded in the specified UTF-16the string created by the code unit sequence.

Because fromCharCode() is a static method of String, you should always use it asString.fromCharCode(), rather than using it as a method to create a String object.

Syntax:

String.fromCharCode(n1, n2, ..., nN)
String.fromCharCode(65);   // 'A'
Test and see‹/›

Browser Compatibility

All browsers fully support the fromCharCode() method:

Method
fromCharCode()IsIsIsIsIs

Parameter Value

ParameterDescription
n1, n2, ..., nNA sequence of numbers, which is a UTF-16Code unit. The range is from 0 to65535Range from (0xFFFF).

Technical Details

Return value:A string representing characters, representing the specified unicode number
JavaScript version:ECMAScript 1

More examples

Convert multiple UTF-16Value conversion to character:

String.fromCharCode(78,72,79,79,79);  // 'w3codebox'
Test and see‹/›

 JavaScript String Object