How to convert between number bases
- Binary (BIN) uses only 0 and 1, octal (OCT) the digits 0 to 7, decimal (DEC) 0 to 9 and hexadecimal (HEX) 0 to 9 and A to F.
- Binary to decimal: each position is a power of 2, from right to left 1, 2, 4, 8, 16 and so on. Add up the positions that hold a 1.
- Hexadecimal is handy because one hex digit is exactly four bits; that is why the app groups binary and hex in blocks of four.
- Roman numerals run from 1 to 3999 (I to MMMCMXCIX).
Example: 255 and 2026
The decimal number 255 is 1111 1111 in binary, 377 in octal and FF in hexadecimal, and needs 8 bits. The year 2026 is written MMXXVI in Roman numerals.
In ZakMachine: Number bases
Pick the base of your input (BIN, OCT, DEC, HEX or Roman) and you see the number in all the others, plus the number of bits you need. Prefixes such as 0x and 0b, spaces and underscores are ignored, and you copy every result without formatting. It works with whole numbers from 0 to 18,446,744,073,709,551,615 (64 bits).
Frequently asked questions
How large can the numbers be?
Whole numbers from 0 to 18,446,744,073,709,551,615, so up to 64 bits. Roman numerals run from 1 to 3999. For a number that is too large, the tool says it needs more than 64 bits.
Can I type a prefix such as 0x or 0b?
Yes. A prefix (0x, 0b or 0o), spaces and underscores are ignored, so you can paste a number as it is.
Is this tool free?
Number bases is one of ZakMachine’s 10 free tools. The app works offline and needs no account.
ZakMachine for iPhone, iPad and Mac
Download ZakMachine for free on the App Store.