Number Base Converter
Type a number in binary, decimal, hexadecimal or octal and every other base fills in as you type. It flags invalid digits for the base you picked, so a stray 2 in a binary string will not silently give you a wrong answer.
Number Base Converter tool
| Base | Value |
|---|---|
| Binary (2) | – |
| Octal (8) | – |
| Decimal (10) | – |
| Hexadecimal (16) | – |
Tap a value to copy it.
How to use it
- Type your number in the box.
- Choose which base you typed it in.
- Read every other base below, and tap a value to copy it.
Worked example
Binary, hex and why programmers use them
Every base works the same way: each position is worth the base raised to a power. In decimal, 255 is 2 hundreds plus 5 tens plus 5 ones. In binary the positions are 128, 64, 32, 16, 8, 4, 2 and 1, so 255 is eight ones in a row, 11111111.
Hexadecimal is compact shorthand for binary. One hex digit covers exactly four binary digits, so a byte is always two hex characters: FF is 255, and 00 is zero. That is why colors on the web are written as hex, where #FF0000 means full red, no green and no blue.
Octal groups binary in threes and survives mainly in Unix file permissions, where 755 means read, write and execute for the owner and read plus execute for everyone else.
Common uses
- Reading hex color codes
- Converting file permissions in Unix
- Programming, bitmasks and debugging
- Computer science homework