Number Base Converter
Convert between binary, octal, decimal, hex and any base from 2 to 36.
Type into any field, the rest follow.
Features
- Binary, octal, decimal and hexadecimal at once
- Any custom base from 2 to 36
- Bit and byte width calculation
- Smallest fitting integer type
- Rejects digits that are invalid for the base
How to use it
- Type a number into whichever base you have.
- Every other field updates immediately.
- Use the slider for an unusual base.
- Copy all representations at once.
Why these particular bases
Binary is how hardware actually works, since a transistor is either conducting or not. It becomes unreadable quickly though, a single 32-bit value is 32 characters of ones and zeros with no visual structure, and miscounting a run of them is easy.
Hexadecimal solves that by being a compact, lossless view of binary. Because 16 is 2⁴, exactly one hex digit maps to exactly four bits, so you can convert between the two by inspection with no arithmetic. One byte is always two hex digits. That direct correspondence is why memory addresses, colour codes, hashes and byte dumps are all written in hex.
Octal has the same property with three bits per digit, and survives mainly in Unix file permissions, where the read, write and execute bits form natural groups of three, chmod 755 is really 111 101 101. Bases beyond 16 borrow letters and appear in URL shorteners and identifier encodings, where base 36 packs a number into the shortest string using only digits and letters.
Frequently asked questions
Related tools
Further reading
Read the full guide on the 123MiniApps blog.