Number Base Converter
Convert numbers between binary, octal, decimal, and hex.
Result (Base 16)
FF
All Common Bases
Binary Visualization
1111 1111
Common Conversions
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 0000 | 0 | 0x0 |
| 1 | 0000 0001 | 1 | 0x1 |
| 2 | 0000 0010 | 2 | 0x2 |
| 4 | 0000 0100 | 4 | 0x4 |
| 8 | 0000 1000 | 10 | 0x8 |
| 16 | 0001 0000 | 20 | 0x10 |
| 32 | 0010 0000 | 40 | 0x20 |
| 64 | 0100 0000 | 100 | 0x40 |
| 128 | 1000 0000 | 200 | 0x80 |
| 255 | 1111 1111 | 377 | 0xFF |
| 256 | 0001 0000 0000 | 400 | 0x100 |
| 1024 | 0100 0000 0000 | 2000 | 0x400 |
About the Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal. Every base describes the same quantity in a different notation, and moving between them is routine when reading memory addresses, decoding permission bits, or working with color values and bitmasks.
How to use it
- 1 Enter a number in whichever base you have.
- 2 Every other base updates simultaneously.
- 3 Use the bit view to see the binary representation laid out.
- 4 Copy whichever representation you need.
What it does
- Binary, octal, decimal and hexadecimal at once
- Custom bases from 2 to 36
- Bit-level visualisation
- Large-number support beyond 32 bits
Frequently asked questions
Is my input sent anywhere?
No. Every calculation happens locally in your browser using JavaScript. Nothing you paste is uploaded, logged, or stored on a server, which makes the tool safe to use with production data, credentials, and customer records.
Why do programmers use hexadecimal?
Because one hex digit maps exactly to four bits, so a byte is always two hex digits and the conversion is done by eye. Decimal has no such alignment — 255 gives no hint that it is all eight bits set, while 0xFF is immediately obvious.
What do the 0x, 0b and 0o prefixes mean?
They tell a compiler which base a literal is written in: 0x for hexadecimal, 0b for binary, 0o for octal. Without a prefix, a leading zero means octal in C and several older languages, which is why 010 equals 8 and not 10 — a genuine source of bugs.
Where is octal still used?
Mainly Unix file permissions, where each digit encodes read, write, and execute as three bits — chmod 755 is exactly that. Outside permission bits and a few legacy formats, hexadecimal has replaced it everywhere.
How do I convert hex to decimal by hand?
Multiply each digit by 16 raised to its position from the right, then sum. For 0x1F: F is 15 at position 0, so 15 × 1 = 15; 1 is at position 1, so 1 × 16 = 16; the total is 31.