Home >Web >HTML >How to find the ASCII value of a character

How to find the ASCII value of a character

How to get the numeric value of a character (ASCII, Unicode) and back – quickest right in the browser console.

The quickest way to find the value of a character is the browser console (F12 key, Console tab):
'o'.charCodeAt(0); // 111
'O'.charCodeAt(0); // 79
String.fromCharCode(111); // "o"
'é'.charCodeAt(0); // 233 – for characters outside ASCII it returns the Unicode code

Another option is the website toptal.com/developers/keycode (formerly keycode.info), where you cannot paste a character, but you can see live, for example, that the O key has the code 79. Note that this is the code of the key, not the ASCII value of the character – a lowercase o has the ASCII value 111, an uppercase O 79.