Toolman

ASCII code for the digit 2

50

Digit 2 — 2

Decimal50
Hexadecimal0x32
Octal0062
Binary00110010
HTML entity2

What it is

Digit 2 is one of the 95 printable ASCII characters, the set every text encoding in common use still agrees on. UTF-8 encodes it as the single byte 50, which is why ASCII text is also valid UTF-8.

The full entry

ASCII 50 in full — the code point page, with what sits either side of it and how the character is encoded elsewhere.

Frequently asked questions

What is the ASCII code for the digit 2?

The ASCII code for the digit 2 is 50 in decimal, 0x32 in hexadecimal and 0062 in octal.

What is the digit 2 in binary?

00110010 — eight bits, though ASCII only defines seven, so the top bit is always zero.

Is the digit 2 a printable character?

Yes. Digit 2 is in the printable range, codes 32 to 126, which is everything ASCII can put on a screen.

Other characters

Every character by name · The ASCII table · Text to binary converter