DevKits

ASCII 55

Digit 7 (7)

Printable ASCII

The digit seven. ASCII code 55. Octal (base 8) uses only digits 0-7, so '7' is the largest octal digit — see the oct column above for this character's own octal code.

Common uses & context

The character '7' — the digit 7 — has ASCII code 55 (0x37), not 7. This offset of exactly 48 between a digit's glyph and its numeric value is the single most common beginner trap in low-level text handling: the byte that draws '7' on screen is 55, while the number 7 is a different value entirely. The digit seven. ASCII code 55. Octal (base 8) uses only digits 0-7, so '7' is the largest octal digit — see the oct column above for this character's own octal code.

The ten digit characters '0'–'9' occupy the contiguous range 48–57, which makes digit handling cheap and branch-free. You can test whether a byte is a digit with c >= '0' && c <= '9', and recover its numeric value with c - '0' (equivalently c - 48). Parsing a whole number is then just value = value * 10 + (c - '0') for each character left to right. For '7', that means c - '0' yields 7.

All encodings at a glance

Decimal55
Hexadecimal0x37
Octal0067
Binary00110111
HTML numeric entity&#55;
URL encoding%37
UTF-8 bytes0x37

Code snippets

JavaScript

String.fromCharCode(55); // "7"
55.toString(16); // "37"

Python

chr(55)           # '7'
ord(chr(55))      # 55
hex(55)           # '0x37'

HTML

&#55;   <!-- numeric entity (no named entity for this character) -->

Programming notes

  • Character-to-value: '7' - '0' = 7 (i.e. 55 - 48).
  • Digit test: c >= '0' && c <= '9' works because 0–9 are the contiguous codes 48–57.
  • Multi-digit parse step: value = value * 10 + (c - '0').

Frequently asked questions

What character is ASCII code 55?

ASCII code 55 is the character '7' (Digit 7). In hexadecimal it is 0x37, in octal 0067, and in binary 00110111.

What is 0x37 in ASCII?

Hexadecimal 0x37 equals decimal 55, which is the character '7' (Digit 7). To convert hex to ASCII yourself, read the two hex digits as a base-16 number (0x37 = 55) and look up that code point.

How do I write the character with code 55 in code?

In JavaScript use String.fromCharCode(55); in Python use chr(55); in HTML use the numeric entity &#55;. In a URL it is percent-encoded as %37, and in UTF-8 it is stored as the byte sequence 0x37.

Why is the digit '7' stored as 55 instead of 7?

Because '7' is a text character, not the number 7. Its ASCII code is 55; the numeric value 7 is separate. Subtract 48 (the code of '0') to convert the character to its value: '7' − '0' = 7.

Nearby codes

Encode & convert this character