1

ASCII Code 49

One

About This Character

ASCII code 49 (0x31) represents the One character "1". The digit "1" has ASCII code 49. The digits 0–9 occupy consecutive ASCII codes 48–57, which makes numeric conversion straightforward: subtracting 48 (or 0x30) from any digit character’s ASCII code gives its numeric value. The printable ASCII characters (codes 32–126) include the space, digits, uppercase and lowercase Latin letters, and common punctuation symbols. These 95 characters form the foundation of text representation in virtually all computing systems and are universally supported across all character encodings, programming languages, and operating systems.

Character Encoding

Decimal 49
Octal 061
Hexadecimal 0x31
Binary 00110001
HTML Code 1
HTML Entity
Unicode U+0031
Unicode Name DIGIT ONE
URL Escape %31
Quoted-Printable 1
UTF-8 (Hex) 31
Category Printable — Digits

How to Type in Code

JavaScript
// Character literal
let char = '1';
// Using char code
let char2 = String.fromCharCode(49);
// Unicode escape
let char3 = '\x31';
Python
# Character literal
char = '1'
# Using chr()
char = chr(49)
# Using ord() to get code
code = ord('1')  # Returns 49
HTML
<!-- Direct character -->
1
<!-- HTML entity (numeric) -->
&#49;
<!-- Hex entity -->
&#x31;
C#
// Character literal
char c = '1';
// Using cast
char c2 = (char)49;
// To get code from char
int code = (int)'1';  // Returns 49

See Also

Copied!