How positional number systems work
Every base uses the same principle: each digit position represents a power of the base, increasing right to left.
In decimal, 255 means (2 × 10²) + (5 × 10¹) + (5 × 10⁰). In binary, 11111111 means (1 × 2⁷) + (1 × 2⁶) + … + (1 × 2⁰) = 255. In hexadecimal, FF means (15 × 16¹) + (15 × 16⁰) = 255.
The same quantity, three notations. The base changes how the number is written, never what it is.
Why computing settled on these bases
Binary is unavoidable at the hardware level. A transistor is either conducting or not, so two states is what the physics gives you. Everything above is built on that.
Hexadecimal exists because binary is unreadable at length. Since 16 = 2⁴, each hex digit maps to exactly four binary digits with no arithmetic required. The byte 11010110 becomes D6 — the same information, a quarter of the characters, and the mapping is memorisable.
This is why hex appears everywhere bytes are shown: colour codes, memory addresses, MAC addresses, hash digests, and byte-level debugging.
Octal groups binary in threes, since 8 = 2³. It was common on older architectures with word sizes divisible by three and survives mainly in Unix file permissions, where each digit encodes read, write, and execute as three bits — 755 being 111 101 101.
Reading hexadecimal fluently
A byte is eight bits, which is exactly two hex digits, so a byte ranges from 00 to FF — 0 to 255. Recognising a few anchor points makes hex much easier to read at a glance:
0F= 15 — the low nibble full10= 16 — where the second digit begins7F= 127 — the largest signed byte80= 128 — the high bit setFF= 255 — every bit setFFFF= 65,535 — two bytes full
Prefixes signal the base in most languages: 0x for hex, 0b for binary, 0o for octal.
Where base conversion shows up in practice
Colours. A CSS colour such as #2563EB is three bytes — red 0x25 (37), green 0x63 (99), blue 0xEB (235).
File permissions. chmod 644 sets owner read-write (110) and group and others read-only (100, 100).
Bitmasks and flags. Individual bits within an integer are far easier to reason about in binary or hex than decimal.
Networking. Subnet masks and IPv6 addresses are naturally expressed in binary and hex respectively.
Character encoding. Unicode code points are conventionally written in hex, as in U+1F600.
Bases beyond 36 and other systems
This converter supports bases 2 to 36, using digits 0–9 then letters A–Z. Thirty-six is the practical limit for case-insensitive alphanumeric digits.
Higher bases exist by adding more symbols. Base64 uses 64 characters to encode binary data as text — though it is an encoding scheme rather than a numeral system in the arithmetic sense. Base58, used in some cryptocurrency addresses, deliberately omits characters that are easily confused: 0, O, I, and l.
A note on precision: this tool works within JavaScript's safe integer range, up to 2⁵³ − 1. Values above that lose precision, and arbitrary-precision arithmetic is needed instead.
Frequently asked questions
Why do programmers use hexadecimal?
Because 16 is a power of 2, each hex digit maps to exactly four binary digits. This makes hex a compact, readable shorthand for binary with no arithmetic required to convert between them.
How many bits is one hexadecimal digit?
Four. A byte is eight bits, so it is exactly two hex digits, ranging from 00 to FF - decimal 0 to 255.
Why are Unix file permissions in octal?
Because each permission group has three bits - read, write, execute - and octal groups binary in threes. So 755 means 111 101 101: full permissions for the owner, read and execute for everyone else.
What is the largest base this supports?
Base 36, using digits 0-9 followed by letters A-Z. That is the practical limit for case-insensitive alphanumeric digits.