If you've ever seen a color written as 0xFF or a permission set as 755, you've met number bases other than the decimal you grew up with. Once you understand how positional value works, switching between binary, octal, decimal, and hexadecimal becomes mechanical — and a lot less intimidating.
What "base" actually means
The base of a number system is how many distinct digits it uses, and each position is a power of that base. Decimal (base 10) uses digits 0–9, and each place is a power of ten: ones, tens, hundreds, and so on.
- Binary (base 2): digits 0–1; places are 1, 2, 4, 8, 16…
- Octal (base 8): digits 0–7; places are 1, 8, 64…
- Decimal (base 10): digits 0–9; places are 1, 10, 100…
- Hexadecimal (base 16): digits 0–9 then A–F (A=10 … F=15); places are 1, 16, 256…
The number 1011 means something different in each base — context is everything.
A worked binary example
Take binary 1011. Read the digits right to left and multiply each by its place value:
| Digit | Place value | Contribution |
|---|---|---|
| 1 | 8 | 8 |
| 0 | 4 | 0 |
| 1 | 2 | 2 |
| 1 | 1 | 1 |
Add them up: 8 + 0 + 2 + 1 = 11 in decimal. That's all conversion is — summing each digit times its positional weight.
Why hex is everywhere in code
Hexadecimal is popular because one hex digit maps cleanly to exactly four binary digits, making long binary strings readable. The classic example: decimal 255 = 0xFF, because F is 15 and the value is (15 × 16) + 15 = 255. That's also why an 8-bit byte tops out at 255 and a single byte fits in two hex digits.
This is the same logic behind color codes. In a hex color like #FF0000, each pair of hex digits is one color channel from 0 to 255 — exactly the kind of conversion the Color Converter handles when it shows you the RGB equivalent.
How to use it
Converting bases by hand is great for learning but tedious in practice. The Number Base Converter lets you type a value in any base and instantly see it in binary, octal, decimal, and hex side by side — perfect for debugging bitmasks, reading memory dumps, or sanity-checking hardware registers.
A few practical tips:
- Prefixes signal the base:
0bfor binary,0ofor octal,0xfor hex. - Hex digits are case-insensitive, so
0xffand0xFFare identical. - When a number "looks wrong," check whether you're reading it in the base you think you are.
Number bases are just one flavor of conversion you'll meet as a developer. If you also work with physical measurements in firmware or IoT projects, the Unit Converter covers length, weight, and temperature so you can keep every conversion in one trusted place.