Widely availableSupported across all major browsers. Safe to use in production.

Overview

The codePointAt() method returns the numeric value of the UTF-16 code point at an index of the string. The fromCodePoint() method returns a string created from one or more code points.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
41
12
29
9
41
9
Built-in object

The String.fromCodePoint() static method returns a string created from the specified sequence of code points.

41
12
29
9
41
9
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

JAVASCRIPT
'😀'.codePointAt(0);  // 128512
String.fromCodePoint(128512); // '😀'

// charCodeAt cannot handle surrogate pairs correctly
'😀'.charCodeAt(0);  // 55357 (upper surrogate only)

Live demo

co-point. Read

Inputcharacter. Unicode co-point display..emoji also positivecheck in..

PreviewFullscreen

co-point from generate

Number(co-point) from character generate..128512 input and emoji that display..

PreviewFullscreen

saroge-tpea. comparison

CharCodeAt (16bit) and codePointAt (Unicode). Difference inspect it..

PreviewFullscreen

Use cases

  • Using String codePointAt() and fromCodePoint()

    The codePointAt() method returns the numeric value of the UTF-16 code point at an index of the string. The fromCodePoint() method returns a string created from one or more code points.

Cautions

  • No specific concerns. Stable across all major browsers.

Accessibility

  • When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.

Powered by web-features