Number Base Converter
One tool for binary ↔ octal ↔ decimal ↔ hexadecimal. Enter a value in any base and see all four representations.
What is a number base?
Every positional number system works the same way — the base just changes how many digits each position can hold. Decimal (base 10) uses ten digits per position; binary (base 2) uses two; hexadecimal (base 16) uses sixteen, borrowing A through F for the extra six. The value a written number represents is identical across all four; only its notation changes.
Programmers reach for hex and binary constantly — colour codes, bitmasks, memory addresses, file signatures — while networking and classic Unix permissions still lean on octal. This tool runs on arbitrary-precision integers, so very large values (32-, 64-, even 256-bit) convert without losing accuracy.
Number base converter, piece by piece
Each card explains one thing this tool does with your input — how it reads the source base, how it writes the target base, and why arbitrary-precision integers matter for large values.
Reading your input — weighted sum of digits
The converter treats every digit in your input as a coefficient multiplied by the source base raised to that digit's position. Summing those products gives the numeric value in "plain integer" form — this is the step that turns your typed string into a number the tool can re-express in any other base.
Writing the output — repeated division by the target base
To emit each result the calculator divides the integer value by the target base, records the remainder, and repeats on the quotient until zero. The remainders read bottom-up are the digits of the answer; values 10 and above become letters A, B, C… up to Z for base 36.
Arbitrary precision — why 256-bit values still convert exactly
The tool runs on JavaScript's native BigInt, so there is no 64-bit wraparound and no floating-point rounding. Address masks, hash digests, and cryptographic constants convert digit-for-digit regardless of length — the four output boxes always show the same exact number in binary, octal, decimal, and hex.
Digit reference (0–15 across all four bases)
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Features of this calculator
- Convert numbers between any two bases from 2 to 36
- Supports fractional (radix-point) numbers, not just integers
- Shows the step-by-step division/multiplication working
- Quick presets for binary, octal, decimal, and hexadecimal
- Validates digits against the chosen base before converting
Frequently asked questions
+Why is hex used for colours?
Because two hex digits map exactly to one byte (0–255), which is the range of each RGB channel.
+What's the difference between hex A and decimal 10?
They are the same value — hex just uses a single symbol instead of two digits.
+Where is octal still used?
Mostly in Unix file permissions (chmod 755) and a few legacy computing contexts.