What a number base converter does
A positional numeral system represents a number using a base: the count of distinct digits it has to work with. The decimal system (base 10) uses ten digits, 0 through 9. Binary (base 2) uses only 0 and 1, and it is the native language of computers. Octal (base 8) and hexadecimal (base 16) are handy shorthands for long binary strings — in hexadecimal, values above 9 are written with letters (A = 10, B = 11, …, F = 15).
This converter takes a whole number written in the base you pick and instantly rewrites it in the four most common bases — binary, octal, decimal, and hexadecimal — plus any arbitrary base from 2 to 36. Everything is computed in your browser with arbitrary-precision integers (BigInt), so you can convert huge numbers without losing a single digit.
How to use the converter
- Pick the input base from the dropdown (2, 8, 10, 16, or anything up to 36).
- Type the whole number using only digits that are valid for that base. If you enter an impossible digit — a
Gin hexadecimal or a2in binary — you get a gentle warning and no result until you fix it. - Read the cards: the same value appears in binary, octal, decimal, and hexadecimal at once.
- Under Custom base, choose any output base from 2 to 36 to see the number in it. Use each card’s Copy button to grab the result.
There is no “calculate” button — the conversion updates as you type.
The method
Converting from any base to decimal relies on place value: multiply each digit by the base raised to the position it sits in (starting at 0 on the right) and add up the products. To go from decimal to another base, use repeated division: divide by the base, keep the remainder, repeat on the quotient, then read the remainders from bottom to top.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 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 |
| 16 | 10000 | 20 | 10 |
Worked example
Let’s convert 255 in decimal to the three usual bases.
To hexadecimal, by repeated division by 16:
- 255 ÷ 16 = 15, remainder 15 → 15 is written
F - 15 ÷ 16 = 0, remainder 15 →
F
Read from bottom to top: FF.
To binary, dividing by 2 (or noticing that 255 = 256 − 1 = 2⁸ − 1, eight ones): 11111111. To octal, grouping the binary three bits at a time (11 111 111 → 3 7 7): 377.
Checking the other way with place value: FF in hexadecimal is 15 × 16 + 15 = 255; 11111111 in binary is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255; and 377 in octal is 3 × 64 + 7 × 8 + 7 = 255. Everything matches. Two quick extra cases: 1010 in binary is 10 in decimal, and 2A in hexadecimal is 2 × 16 + 10 = 42.
Frequently asked questions
Why does hexadecimal use letters?
Because a base of 16 needs 16 distinct symbols and we only have ten digits (0-9). The missing six are borrowed from the first letters: A, B, C, D, E, and F stand for 10, 11, 12, 13, 14, and 15. The converter accepts those letters in upper or lower case interchangeably.
Can I convert very large numbers?
Yes. The tool uses arbitrary-precision integers, so there is no practical ceiling like the one floating-point decimals hit. A value with dozens of digits converts exactly, with no rounding and no lost final digit.
Does it convert decimals with a fractional part, or only integers?
Only integers. Converting a fractional part between bases can produce infinitely many digits (just as 1/3 in decimal is 0.333…), so this tool focuses on whole numbers, which is the most common use in computing and in class.
What do bases 8 and 16 mean in programming?
They are compact ways to read binary. Each octal digit maps to 3 bits and each hexadecimal digit to 4 bits, so a byte (8 bits) fits in two hex digits. That is why web colors (#FF8800), memory addresses, and many codes are written in hexadecimal.
What happens if I type an invalid digit?
The converter notices the symbol does not belong to the chosen base and shows a warning instead of a wrong answer. Fix the digit and the cards fill back in on their own.