⚡ Curated dev resources & dealsSponsored
DevToolBayFree Developer Tools

Number Bases in Programming: Binary, Hex and What Comes After 36

Why programmers count in bases 2, 8, 10 and 16, how literals work across languages, bit-pair intuition for hex and converting any base up to 36.

Base fluency is a career-long debugging tool. Reading 0x1F, mask math and permission bits all reduce to one skill: switching representations without losing the number.

The four bases you actually meet

  • Binary is hardware truth: flags, masks, permissions (chmod 755 reads as three octal digits, each three bits).
  • Octal survives in Unix permissions and escape sequences.
  • Decimal is for humans and money.
  • Hexadecimal is byte-dense: each pair is exactly one byte, which is why hashes, colors and memory addresses all print in hex.

Hex intuition in one sentence

One hex digit holds 0 through 15 — four bits. Two hex digits are one byte. A 32-bit number is eight hex characters, which is why alignment makes bit patterns visible that decimal hides. Convert any literal instantly with the Number Base Converter, which shows binary, octal, decimal and hex side by side.

Literals across languages

  • JavaScript, C and Java: 0x1F hex, 0b1010 binary, 0o17 octal.
  • Python mirrors those prefixes; older C treats leading-zero decimals as octal — a classic silent bug.
  • JSON allows only decimal — pasting hex literals into configs fails validation for a reason.

Beyond 36? You need BigInt

Base 36 is the ceiling for alphanumeric digits. Hash IDs and big identifiers move to base 58 or base 64 — different alphabets, not bigger digits. For values beyond 64-bit floats, arbitrary precision integers keep huge hex fingerprints exact; the converter supports integer widths far beyond float range.

When hex is not numbers

Hex-encoded bytes sometimes represent text, not numbers. The Hex to Text Converter decodes UTF-8 byte sequences back into readable strings — the step between seeing bytes and understanding them.

Related guides

Try these tools