Base Converter
Convert between decimal, binary, octal, and hexadecimal instantlyEnter a number in any base — all others update instantly
Quick reference — decimal 0–15
| Dec | Bin | Oct | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Frequently Asked Questions
What is a number base converter?
A number base converter translates a number between different positional notation systems — decimal (base 10), binary (base 2), hexadecimal (base 16), and octal (base 8). Type a value in any field and all other representations update instantly.
How do I convert binary, octal, or hexadecimal to decimal by hand?
Multiply each digit by its base raised to the position power: binary 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. Octal 17 = 1×8 + 7 = 15. Hex 1F = 1×16 + 15 = 31. This positional-value method works for any base. In code: parseInt("1F", 16) in JavaScript, int("1F", 16) in Python.
What is hexadecimal used for in programming?
Hex is used where compact representation of binary data matters: memory addresses (0x7FFE0000), color codes (#FF5733), byte values (0xFF), bitmasking (flags & 0x0F), and binary file formats. Each hex digit represents exactly 4 bits, making it far more compact than binary and more precise than decimal for bit-level work.
How do I convert between bases in Python, JavaScript, or Java?
Python: bin(42), oct(42), hex(42) → binary/octal/hex string; int("2a", 16) converts hex to int. JavaScript: (42).toString(2/8/16); parseInt("101010", 2). Java: Integer.toBinaryString(42), Integer.toHexString(42), Integer.parseInt("2a", 16). This online tool handles any base from 2 to 36.
Why do computers use binary internally?
Electronic circuits have two reliable states: on (1) and off (0). Binary maps directly to these states — one bit per transistor. Other bases (decimal, octal, hex) are only used by humans to read and write values; the hardware always operates in base-2. Hexadecimal is popular precisely because each hex digit is exactly 4 bits — a clean mapping to hardware.
About Base Converter
Type a number in any base and see it converted to all others in real time. Supports decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). Uses BigInt internally so there is no upper limit on number size. Works entirely in your browser — no server required.