🔢 Base Converter
How It Works
Type in any base field and the others update live. Negatives (leading −) and fractions are supported; binary output groups digits in fours for readability; and integers beyond 53 bits are parsed with BigInt, so large values never silently lose precision — a common flaw in casual converters.
Bits, Nibbles, Bytes — the Reading Skill
The reason hex dominates programming: one hex digit = exactly four bits (a nibble), so two hex digits = one byte. That makes translations mechanical:
| Binary | Hex | Decimal | Landmark |
|---|---|---|---|
| 1111 | F | 15 | max nibble |
| 1111 1111 | FF | 255 | max byte / max RGB channel |
| 1 0000 0000 | 100 | 256 | 2⁸ |
| 1111 1111 1111 1111 | FFFF | 65,535 | max unsigned 16-bit |
Memorize the powers of two (1, 2, 4, 8, 16 … 1024) and you can convert small binary numbers in your head; use the tool for everything longer.
The 53-Bit Trap in JavaScript
JavaScript's ordinary numbers are 64-bit floats with a 53-bit integer mantissa: above Number.MAX_SAFE_INTEGER (9,007,199,254,740,991) integers start rounding — parseInt on a 60-bit binary string quietly returns the wrong value with no error. This converter parses digit-by-digit into BigInt instead, so a 128-bit UUID half or a 64-bit database ID converts exactly. If you've ever seen two different long IDs "become equal" in a JSON viewer, you've met this bug.
Frequently Asked Questions
Where does octal still show up?
Unix file permissions (chmod 755), escape sequences in some languages (\0 prefix), and legacy specs. Each octal digit is exactly three bits — the read/write/execute triplet.
Why does 0.1 become an endless binary fraction?
A fraction terminates in base 2 only if its denominator is a power of two. 1/10 isn't, so binary 0.1 repeats forever (0.0001100110011…) — the root cause of the famous 0.1 + 0.2 ≠ 0.3 floating-point surprise.
Does uppercase vs lowercase hex matter?
Not to the value — FF and ff are identical. Conventions differ by ecosystem (CSS tends lowercase, memory dumps uppercase); the checkbox above sets your preferred display.
How do I convert a CSS color with this?
Split #RRGGBB into three 2-digit hex pairs and convert each: #1DA1F2 → 1D=29, A1=161, F2=242 → rgb(29, 161, 242). Our Color Buddy tool automates this if you do it often.