Toolman

ASCII 50

ASCII 50 is Digit 2, written 2.

Every representation

Character2
NameDigit 2
Decimal50
Hexadecimal0x32
Octal0062
Binary00110010
HTML entity2
Escape sequence\x32
UnicodeU+0032
GroupDigit

What it is for

The digit 2. The digits occupy 48 to 57, so subtracting 48 from a digit's code gives its numeric value — the oldest trick in character handling.

Where the number comes from

The digits were placed at 48 to 57 so that 0 through 9 are contiguous and the low four bits of each code are the digit's own value: 50 in binary is 00110010, and the last four bits are 0010, which is 2.

Frequently asked questions

What is ASCII 50?

Digit 2, the character 2. In hexadecimal it is 0x32, in octal 0062, and in binary 00110010.

How do I type ASCII 50?

Type 2 directly. In a string literal it can also be written \\x32, and in HTML as 2.

Is ASCII 50 printable?

Yes. Codes 32 to 126 are the printable range, which is every character ASCII can actually display.

Nearby codes

Full ASCII table · Text to binary converter · Number base converter