Number Base Converter
Convert between binary, octal, decimal, hex, and any custom base. Type in any field — all others update instantly.
Quick Reference (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 |
About the Number Base Converter
The Number Base Converter lets you convert any integer between the four most common numeral systems — binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) — as well as any custom base from 2 to 36. Type a value in any field and all others update instantly, making bidirectional conversion effortless.
Each numeral system uses a different set of digits to represent the same underlying value. Decimal uses 0–9, binary uses only 0 and 1, octal uses 0–7, and hexadecimal uses 0–9 plus A–F. Understanding these bases is fundamental to computer science, programming, networking, and digital electronics.
How to Convert Between Number Bases Online
- Type your number into any field — Binary, Octal, Decimal, Hexadecimal, or Custom Base.
- All other fields update instantly with the equivalent value in their respective base.
- For hexadecimal input, you can include or omit the
0xprefix; for binary,0bis also accepted. - To use a custom base (e.g. base 3, base 12, base 32), adjust the Base spinner in the Custom Base field.
- Click the copy icon next to any field to copy that value to your clipboard.
- Use Load Sample (255) to see a worked example across all bases at once.
Common Use Cases for Number Base Conversion
- Programming and debugging — Quickly convert memory addresses, bitmasks, and register values between hex and decimal or binary.
- Web development — Translate CSS hex color codes to decimal RGB components and back.
- Networking — Convert IP addresses and subnet masks between decimal and binary for CIDR calculations.
- Computer science education — Practise number base conversions and verify hand-worked answers instantly.
- Embedded systems and hardware — Work with binary flags, octal file permissions (Unix chmod), and hex memory maps.
- Cryptography and encoding — Inspect binary and hex representations of byte values during protocol analysis.
- Base-32 / Base-36 encoding — Encode IDs and tokens in compact alphanumeric form using a custom base.
Frequently Asked Questions
What is a number base (radix)?
A number base, or radix, defines how many unique digits are used to represent numbers. Base 10 (decimal) uses digits 0–9, base 2 (binary) uses 0–1, base 16 (hexadecimal) uses 0–9 and A–F. All bases represent the same underlying integers — just written differently.
How do I convert decimal to binary?
Type your decimal number into the Decimal field. The binary equivalent appears instantly in the Binary field. For example, 255 in decimal is 11111111 in binary (eight 1-bits, all set).
How do I convert hex to decimal?
Enter your hex value (with or without the 0x prefix) into the Hexadecimal field. The decimal result updates immediately. For example, FF equals 255 in decimal.
What bases does the custom base field support?
Any integer base from 2 to 36. Digits use the characters 0–9 followed by A–Z for values 10–35. This covers common encodings like base 32 (used in TOTP secrets) and base 36 (alphanumeric IDs).
Why does my hex input show an error?
Hexadecimal only accepts digits 0–9 and letters A–F (case-insensitive). Characters outside that set — such as G, H, or spaces — will trigger an error. Remove any invalid characters and the conversion will proceed.
Does this tool support negative numbers?
Yes. Prefix your value with a minus sign (e.g. -42 in decimal) and all fields will show the negative equivalent in their respective base.
What do the 8-bit, 16-bit, and 32-bit indicators mean?
When you enter a positive number, the tool shows the minimum integer width needed to store it: 8-bit for values 0–255, 16-bit for 256–65 535, 32-bit for larger values. This is useful when working with typed data structures in C, Rust, or assembly.