"0" the character vs 0 the number — binary and text
corethe most common encoding confusion
Answer
00110000
Why this example is worth doing
The character 0 is encoded as 48, not as 0, and confusing the two is the single most common error when students first handle text as bytes. The page shows both bytes side by side and gives the conversion rule — subtract 48, or mask off the low four bits — which is exactly what a real parser does. It also notes that the digits were placed at 48 so that this masking trick works.
Try your own input in the Binary ⇄ text / ASCII. Convert text to binary and back, byte by byte, with the full UTF-8 breakdown.
How the answer is reached
ASCII encoding of 1 character
ASCII: one byte per character, the high bit always zero.
| character | code point | decimal | hex | binary | template |
|---|---|---|---|---|---|
| 0 | U+0030 | 48 | 30 | 00110000 | 0xxxxxxx |
| count | value |
|---|---|
| bytes | 1 |
| code points | 1 |
| UTF-16 code units | 1 |