Number Base Converter
Type a number in any of four boxes and the binary, octal, decimal and hex values update together.
Quick Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
The converter shows one number in binary, octal, decimal and hexadecimal side by side. Type in any box and the other three update immediately. Everything runs in this page.
Enter 200 in the decimal box and you get binary 11001000, octal 310 and hex C8. Once you have the binary, the other two come from grouping digits.
| Step | Value |
|---|---|
| Binary (128 + 64 + 8) | 11001000 |
| Groups of 4 equal one hex digit | 1100 1000 = C 8 |
| Groups of 3 equal one octal digit | 11 001 000 = 3 1 0 |
Enter FF, 8A and 3D from the CSS color #FF8A3D in the hex box one at a time and you get 255, 138 and 61. Enter 755 from chmod 755 in the octal box and you get binary 111101101, which splits into the read, write and execute bits for owner, group and everyone else.
When values vanish or change
Characters that do not exist in a base are dropped. Typing 1021 into the binary box reads as 101, which is 5, and if nothing valid is left every box clears. A decimal point and a minus sign are dropped too, so only whole numbers from 0 up are handled. Numbers above 9007199254740991 lose precision in their last digits. A leading 0x or 0b is stripped, so pasted values work as they are. To pick a color visually, use the Color Picker.