Number Base Converter
Choose the base your number is written in — binary, octal, decimal or hexadecimal — type it, and see its value in all four bases at once. The tool also shows the repeated division by 2 behind the binary result, and copies every base in one click. Free, no sign-up.
Input base
How to Use the Number Base Converter
- 1. Pick the input base. Decimal is selected first. Choose binary, octal or hexadecimal if that is how your number is written.
- 2. Type the number. Use digits only: 0–1 for binary, 0–7 for octal, 0–9 for decimal, and 0–9 plus A–F (either case) for hexadecimal. Leave out prefixes such as 0x or 0b.
- 3. Read all four bases. The binary, octal, decimal and hexadecimal values appear together. Copy All Bases copies them as four labelled lines.
- 4. Follow the steps. Under the results, the tool lists each division by 2 and its remainder, so you can see how the binary digits come out.
How Base Conversion Works
In any base b, each digit is worth its face value times a power of b, and the number is the sum: value = Σ dᵢ × bⁱ. The hexadecimal number 1F4 is 1 × 16² + 15 × 16 + 4 = 256 + 240 + 4 = 500. To go from decimal to another base, divide repeatedly by the base and read the remainders from last to first. For 13 in binary: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1 — reading upward gives 1101.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 13 | 1101 | 15 | D |
| 255 | 11111111 | 377 | FF |
| 500 | 111110100 | 764 | 1F4 |
| 1000 | 1111101000 | 1750 | 3E8 |
| 2026 | 11111101010 | 3752 | 7EA |
| 65535 | 1111111111111111 | 177777 | FFFF |
Shortcuts Between Binary, Octal and Hex
Because 8 and 16 are powers of 2, you can convert between binary and them without going through decimal. Group the binary digits from the right in threes for octal or fours for hexadecimal, and replace each group with one digit: 111110100 splits as 1 1111 0100 for hex, giving 1, F and 4 — so 1F4. This is why hexadecimal is the usual way to write bytes (255 is FF) and why octal appears in Unix file permissions, where 755 is 111 101 101 in binary: read, write and execute for the owner, and read and execute for everyone else.
What this tool does not cover
It converts non-negative whole numbers up to 9007199254740991 (2⁵³ − 1), the largest integer JavaScript represents exactly. Negative numbers, fractions and floating-point values are not supported, and neither are digit separators or prefixes. For negative integers use the Two's Complement Calculator; for floating point, the IEEE 754 Converter.
Which Tool Do You Need?
| You want to… | Use |
|---|---|
| Convert a whole number between binary, octal, decimal and hex | This converter |
| Add, subtract, multiply or divide binary numbers, or apply AND, OR and XOR | Binary Calculator |
| Write a negative integer in binary | Two's Complement Calculator |
| Turn text into binary, hex or ASCII codes | Binary Code Translator, Text to Hex Converter or ASCII Code Converter |
| See how a decimal fraction is stored as a float | IEEE 754 Converter |
Frequently Asked Questions
- How do I convert a number between bases?
- Enter the number, pick the base it is written in, and the tool shows its value in binary, octal, decimal and hexadecimal at once. Switch the input base and type a different number to go another way.
- How do I convert decimal to binary?
- Divide the number by 2 repeatedly, noting each remainder, until the quotient reaches 0. Reading the remainders from last to first gives the binary digits. The tool shows these exact steps; 500 gives 111110100.
- How do I convert hexadecimal to decimal?
- Multiply each digit by a power of 16, starting from 16⁰ on the right, and add: 1F4 is 1 × 256 + 15 × 16 + 4 = 500. In the tool, choose Hexadecimal as the input base, type 1F4, and read 500 in the decimal card.
- What digits are valid in each base?
- Binary uses 0 and 1, octal 0–7, decimal 0–9, and hexadecimal 0–9 plus A–F, where A is 10 and F is 15. Any other character is flagged with the digits that are allowed.
- How large a number can I convert?
- Up to 9007199254740991, the largest safe integer in JavaScript. The conversion uses exact integer arithmetic, so every digit is correct in all four bases. Larger values are rejected rather than rounded.
- Is my number sent to a server?
- No. The conversion runs in your browser and nothing you type leaves your device.