W3Schools.com

JavaScript fromCharCode() Method

String Object Reference JavaScript String Object

Definition and Usage

The fromCharCode() method converts Unicode values to characters.

Note: This method is a static method of the String object. The syntax is always String.fromCharCode() and not string.fromCharCode().

Syntax

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

Parameter Description
n1, n2, ..., nX Required. One or more Unicode values to be converted


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The fromCharCode() method is supported in all major browsers.


Example

Example

Convert Unicode values to characters:

<script type="text/javascript">

document.write(String.fromCharCode(72,69,76,76,79));

</script>

The output of the code above will be:

HELLO

Try it yourself »


String Object Reference JavaScript String Object
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE