Number Base Converter
Type a number in any base — binary, octal, decimal or hexadecimal — and all other bases update instantly. Supports large integers. Runs entirely in your browser with no data uploaded.
Number Base Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 4 | 0100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 1 0000 | 20 | 10 |
| 255 | 1111 1111 | 377 | FF |
| 256 | 1 0000 0000 | 400 | 100 |
Why Hexadecimal in Programming?
Hex is popular in programming because it maps cleanly to binary: each hex digit represents exactly 4 bits. A full byte (8 bits) is always two hex digits. This makes reading memory addresses, color codes and bitmasks much easier than looking at long binary strings.
How to Convert Manually
To convert decimal to binary, repeatedly divide by 2 and note the remainders. To convert from binary to hex, group the binary digits into groups of 4 from the right and convert each group. For example: 11011001 → 1101 1001 → D 9 → D9.
Frequently Asked Questions
What is a number base?
The radix defines how many digits a number system uses. Decimal = 10, binary = 2, octal = 8, hexadecimal = 16.
Why do computers use binary?
Binary maps to the two physical states of electronic circuits: on (1) and off (0). All computer data is ultimately binary.
What is hexadecimal used for?
Hex compactly represents binary data — one hex digit = 4 bits, so a byte is two hex digits. Used for memory addresses, colors and bitmasks.
Can I convert negative numbers?
This tool converts positive integers. Negative binary uses two's complement, which requires knowing the word size.