What Is a Number Base?
A number base — also called a radix — is the number of unique digits a system uses to represent values. You use decimal (base 10) every day, but computers think in binary (base 2), and programmers constantly move between binary, octal, decimal, and hexadecimal depending on the task. A number base converter translates a single value between all of these systems so you do not have to do the arithmetic by hand.
The same quantity has a different shape in every base. Decimal 255 is 11111111 in binary, 377 in octal, and FF in hexadecimal — all identical values, just written with different digit sets. Understanding how they relate is core to bit manipulation, low-level debugging, networking, and reading raw data.
This tool converts your input to all four bases at once and also reports how many bits and bytes the value occupies, plus a grouped binary view that splits the bits into readable 4-bit nibbles.
How to Use This Number Base Converter
- Choose the input base in the From selector — Binary (2), Octal (8), Decimal (10), or Hexadecimal (16).
- Type or paste your number. Prefixes like
0b,0o, and0xare stripped automatically, so pasting a code literal such as0xDEADBEEFworks as-is. - Read every base instantly. Output updates as you type and with
Ctrl+Enter; the copy button grabs the full result, andCtrl+Lclears the workspace.
The output block shows binary (with and without 4-bit grouping), octal, decimal, and uppercase hexadecimal, followed by the bit length and byte count — handy when you need to know whether a value fits in 8, 16, or 32 bits.
How to Convert Binary to Decimal (Step by Step)
Binary uses only 0 and 1, and each position is a power of two. Reading right to left, the place values are 1, 2, 4, 8, 16, 32, 64, 128, and so on. To convert, multiply each digit by its place value and sum them:
Binary: 1 0 1 1 0 1 0
Place: 64 32 16 8 4 2 1
Value: 64 +0 +16 +8 +0 +2 +0 = 90
So 1011010 equals decimal 90. The tool does this for you the moment you select Binary as the input base — but knowing the method helps you sanity-check results and answer interview questions.
How to Convert Decimal to Binary (Step by Step)
Go the other way with repeated division by 2, recording each remainder, then read the remainders bottom to top:
90 ÷ 2 = 45 remainder 0
45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1 → read up: 1011010
The same divide-and-collect-remainders trick works for any target base — divide by 8 for octal or 16 for hexadecimal.
Hex and Octal Shortcuts
Because 16 and 8 are both powers of two, hex and octal convert to binary without any arithmetic:
- Hex ↔ binary: each hex digit is exactly 4 bits (a nibble).
F=1111,A=1010, so0xFA=1111 1010. - Octal ↔ binary: each octal digit is exactly 3 bits.
7=111, so octal0o75=111 101.
That nibble/triplet mapping is why the grouped-binary output is so useful — you can read the hex value straight off the 4-bit groups.
Number Base Reference Table
| Base | Name | Digits | Prefix | Common use |
|---|---|---|---|---|
| 2 | Binary | 0-1 | 0b | Bit manipulation, flags, hardware |
| 8 | Octal | 0-7 | 0o | Unix file permissions (chmod 755) |
| 10 | Decimal | 0-9 | — | Everyday math, most APIs |
| 16 | Hexadecimal | 0-9, A-F | 0x | Colors, memory addresses, byte dumps |
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
Common Errors and Limitations
- Invalid digit for the base. A
2in a binary number, an8in octal, or aGin hex is not a legal digit, and the tool reports “Invalid number for base N”. Double-check you selected the right From base. - Large-number precision. JavaScript represents numbers as 64-bit floats, so integers above
9,007,199,254,740,991(2⁵³−1) can round. For 64-bit register values, checksums, or crypto material, use aBigInt-based conversion in code instead. - No fractional or negative parts. This is an integer converter. Values with a decimal point (
3.14) or a sign are outside its scope; convert the integer part only. - Leading zeros are dropped.
00001010and1010produce the same result, since leading zeros carry no value. Use the bit-count field if you need to reason about a fixed width.
Common Use Cases
- Bitwise programming — verify masks and flags by seeing the exact bit pattern behind a hex constant like
0x1F. - File permissions — Unix
chmodmodes are octal; convert755or644to binary to read the read/write/execute bits directly, or pair this with the chmod calculator. - Colors and memory — hex color codes and pointer addresses are base 16; convert them to decimal for calculations or to binary to inspect individual channels.
- Networking — subnet masks and IP octets are easiest to reason about in binary.
- Debugging and CTFs — quickly decode a value you found in a hex dump, register, or wire capture.
Number Base Converter vs Language Built-ins
Most languages can convert bases in code — parseInt("FF", 16) and (255).toString(2) in JavaScript, int("FF", 16), bin(), oct(), and hex() in Python, or printf "%x" in the shell. Those are perfect inside a program, but when you just need a quick answer you would otherwise open a REPL, remember the exact call, and read past the 0b/0x prefix. This converter gives you all four bases plus bit and byte counts in one glance, with nothing to install and no data leaving your browser — the fastest path when you are reading a spec, a diff, or a stack trace and simply need to know what a number is.