1

ASCII Character: One

ASCII Code 49 · Unicode U+0031 · Hex 0x31

one 1

About the One 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.

Encoding Details

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

Source Code Examples

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

Navigate

Copied!