Developer Tools
Number Base Converter
Convert a number between binary, octal, decimal and hexadecimal instantly. Enter a value, choose its base, and see it in every other base — with one-click copy. Runs entirely in your browser.
How to convert between binary, octal, decimal and hex
- Type the digits into the Value box — the example 1010 is there when the page opens.
- Set From base to the base those digits are written in: Binary (2), Octal (8), Decimal (10) or Hex (16).
- The three other bases appear instantly in the cards below; the card for your input base is hidden.
- Click Copy next to any card to put that representation on the clipboard; the button shows a tick for a second.
- If the cards show a dash and a red message, remove the digit that is not valid in the chosen base.
Place values in four bases
A positional number system gives each digit a weight equal to the base raised to its position, counting from zero on the right. The converter parses your digits with the chosen base to get an integer, then writes that integer out in the other three bases. Hexadecimal and octal are popular because they map neatly onto binary: one hex digit is exactly four bits and one octal digit is exactly three, so 7e8 is 0111 1110 1000.
| Base | Digits | Place values (right to left) | 2024 |
|---|---|---|---|
| Binary (2) | 0, 1 | 1, 2, 4, 8, 16, … | 11111101000 |
| Octal (8) | 0–7 | 1, 8, 64, 512, … | 3750 |
| Decimal (10) | 0–9 | 1, 10, 100, 1,000, … | 2024 |
| Hex (16) | 0–9, a–f | 1, 16, 256, 4,096, … | 7e8 |
The four bases offered, with 2024 written in each.
Worked example: 7e8 in hex
Reading 7e8 from the right: 8 × 1 = 8, e (14) × 16 = 224, and 7 × 256 = 1,792. Adding them gives 2,024. To write 2,024 in octal, divide by 8 repeatedly and collect the remainders: 2,024 ÷ 8 = 253 remainder 0, 253 ÷ 8 = 31 remainder 5, 31 ÷ 8 = 3 remainder 7, 3 ÷ 8 = 0 remainder 3. Read the remainders from last to first: 3750. The binary form, 11111101000, falls out of the hex digits directly: 7 = 0111, e = 1110, 8 = 1000, with the leading zero dropped.
Input rules the validator enforces
- Only digits that exist in the selected base are allowed; a 2 in a binary number or a g in hex triggers the error message.
- Hex letters can be typed in upper or lower case, but every hex result is printed in lowercase (ff, not FF).
- Prefixes such as 0x, 0b or 0o are rejected because the x, b or o is not a valid digit; type the bare digits.
- Only unsigned whole numbers are accepted: no minus sign, no decimal point, no spaces between digits (spaces around the value are trimmed).
- Leading zeros are ignored, so 0010 in binary converts as 2.
- There is no upper limit: the conversion uses arbitrary-precision integers, so a 64-bit value such as 18446744073709551616 (2^64) converts exactly to 10000000000000000 in hex and a 1 followed by 64 zeros in binary. Very long inputs simply produce very long outputs.
Values worth recognising on sight
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | ff |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
| 4096 | 1000000000000 | 10000 | 1000 |
| 65535 | 1111111111111111 | 177777 | ffff |
Round numbers in each base, as the converter prints them.
Where each base shows up
- Unix file permissions: chmod 755 is octal for rwxr-xr-x, or 111 101 101 in binary.
- CSS colours: #ff8800 is three hex bytes, which the converter turns into 255, 136 and 0 one at a time.
- Subnet masks: 255.255.255.0 is four bytes of 11111111, 11111111, 11111111, 00000000.
- Unicode code points: U+00E9 (é) is hex e9, decimal 233.
- Memory addresses, hashes and MAC addresses are written in hex because two digits describe exactly one byte.
Frequently asked questions
How do I convert binary to decimal?
Enter your binary number, set the “From base” to Binary (2), and the decimal value appears automatically along with octal and hex.
Which bases are supported?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) — the most common bases used in computing and maths.
What if I enter an invalid digit?
The converter validates your input for the chosen base. A digit that doesn't belong (like a 2 in a binary number) is flagged instead of giving a wrong answer.
Is it free?
Yes — free, no sign-up, and every conversion runs locally in your browser.
Why is the hex result in lowercase?
The converter formats hex with lowercase letters, matching the style of CSS, URLs and most programming languages. Both cases mean the same value, so you can capitalise it after copying if a form requires it.
Can I convert a negative number or a fraction?
No. Only unsigned integers are accepted; a minus sign or decimal point is treated as an invalid digit. Convert the magnitude and add the sign yourself.
What is the largest number the converter accepts?
None in practice. The converter works on arbitrary-precision integers, so 2^64, a 256-bit hash or a 100-digit decimal all convert exactly; only the width of the result cards limits what is comfortable to read.
Does it accept the 0x prefix for hex?
No. Enter the digits without 0x and select Hex (16) as the From base; the x would otherwise be rejected as an invalid digit.
Explore
113 tools. Zero uploads. One place.
Every tool opens instantly, works on your phone and keeps your files on your device.
Number Base Converter guides
Related tools
JSON Formatter
Developer Tools
Format, validate and minify JSON instantly.
Open toolBase64 Encode / Decode
Developer Tools
Encode text to Base64 or decode it back.
Open toolURL Encode / Decode
Developer Tools
Percent-encode or decode URLs and query strings.
Open toolUUID Generator
Developer Tools
Generate random UUID (v4) identifiers in bulk.
Open tool