All representations
| Format | Value |
|---|---|
| Name | Digit 2 |
| Decimal | 50 |
| Hexadecimal | 0x32 |
| Octal | 062 |
| Binary | 00110010 |
| HTML numeric entity | 2 / 2 |
| Unicode code point | U+0032 |
| URL encoded | %32 |
| UTF-8 bytes | 32 (one byte, same as ASCII) |
Notes
- Subtracting 48 from the code gives the digit value 2.
- In C:
'2' - '0' == 2.
Nearby codes
Get this code in code
JavaScript '2'.charCodeAt(0) // 50
Python ord('2') # 50
C (char)50