HomeDevText & encodingASCII value of '0'
Text tools

ASCII value of '0'

ASCII code for the digit '0' is 48 (decimal). Hex, binary, octal, escape sequences, HTML entities, and how to type the zero character.

ASCII digit '0' specification

Version 1.0.0 · Last reviewed 2026-07-28

Definition
The digit character '0' maps to ASCII/Unicode code 48 (0x30). Digits '0'–'9' occupy consecutive codes 48–57.
What it calculates
Documents the ASCII / Unicode encodings for the digit character '0' (decimal 48) and the consecutive digit block 0–9.
Inputs
  • Reference lookup for digit character '0' (not the integer zero)
Outputs
  • Decimal 48 · hex 0x30 · binary 00110000 · octal 60
  • Escape \x30 · HTML 0 · Unicode U+0030
  • Digit block codes 48–57 for '0'–'9'
Formula
code('0') = 48; code(d) = 48 + (d - '0') for digits 0–9

The digit '0' (character zero) has ASCII code 48. Digits 0–9 occupy consecutive codes 48–57 (hex 0x300x39).

ASCII codes for '0'

Property Value
Character 0
Decimal code 48
Hex code 30
Binary code 00110000
Octal code 60
Escape sequence \x30
HTML code 0

Digit codes 0–9

Digit Decimal Hex
0 48 30
1 49 31
2 50 32
3 51 33
4 52 34
5 53 35
6 54 36
7 55 37
8 56 38
9 57 39

How to type

Method '0'
Keyboard 0 key (top row or numpad)
Windows Alt code Alt+48
C/C++ escape \x30 or \060
HTML entity 0
Unicode U+0030

FAQ

What is the ASCII value of zero?

Decimal 48, not 0. The numeric value zero as an integer is different from the character '0'.

Is ASCII 0 the same as the character '0'?

No. ASCII 0 (NUL) is a null control character. The digit '0' is ASCII 48.

How do I convert a digit character to its numeric value?

Subtract 48 (or '0' in C): '5' - '0'5.

What is the hex code for '0'?

0x30 (hexadecimal 30).

Are digit codes consecutive in ASCII?

Yes. '0' through '9' are codes 48–57, making numeric parsing straightforward.

Assumptions
  • Standard ASCII / Unicode Basic Latin: digits 0–9 are codes 48–57.
  • ASCII 0 (NUL) is a different character from digit '0' (48).
  • Reference page; encodings are fixed by the ASCII standard.
Units
  • Dec / Oct: integer
  • Hex: two hex digits
  • Bin: 8-bit string
Boundary conditions
  • Digit characters are 48–57 only; numeric value 0 is not code 0.
  • NUL (code 0) must not be confused with character '0'.
Example
'0' → dec 48 · hex 0x30 · bin 00110000 · HTML 0
Validation cases
  • '0' → 48 / 0x30 / 00110000
  • '9' → 57 / 0x39
  • NUL (code 0) → Not the digit character
Sources
  • ANSI X3.4 / ISO/IEC 646 ASCII
  • Unicode Standard (Basic Latin / Latin-1 Supplement where applicable)
Last reviewed
2026-07-28
Calculation version
1.0.0