Base N Converter
Every number system is built on the same idea: positional notation with a different base. This converter handles all common bases — binary (2), octal (8), decimal (10), and hexadecimal (16) — and shows the full step-by-step solution for every conversion so you can follow the method and learn it yourself.
Notes
How Every Number System Works
In any base-B number system, a number is written as a sequence of digits, each from 0 to B−1. The rightmost digit represents B⁰ = 1. Moving left, each position's weight is multiplied by B. For decimal, B=10 so positions represent 1, 10, 100, 1000… For binary, B=2 so positions represent 1, 2, 4, 8…
| System | Base | Digits used | Position weights (right to left) |
|---|---|---|---|
| Binary | 2 | 0, 1 | 1, 2, 4, 8, 16, 32, 64, 128, … |
| Octal | 8 | 0–7 | 1, 8, 64, 512, 4096, … |
| Decimal | 10 | 0–9 | 1, 10, 100, 1000, 10000, … |
| Hexadecimal | 16 | 0–9, A–F | 1, 16, 256, 4096, 65536, … |
The Two-Step General Conversion Method
To convert a number from any base B to any base C, use two steps. First, convert to decimal using positional notation (multiply each digit by B raised to its position, sum the results). Then convert from decimal to base C using repeated division (divide by C repeatedly, collect remainders from bottom to top).
Example: Convert (374)₈ to Hexadecimal
Step 1 — Octal to Decimal:
Step 2 — Decimal to Hex (divide by 16):
| Dividend | ÷ 16 | Quotient | Remainder |
|---|---|---|---|
| 252 | ÷ 16 | 15 | C (12) |
| 15 | ÷ 16 | 0 | F (15) |
Shortcut Conversions (Skip the Decimal Step)
For conversions involving binary, octal, and hex, direct bit-grouping methods are faster than going via decimal.
| Conversion | Shortcut method |
|---|---|
| Binary → Octal | Group binary into 3-bit chunks from right → each chunk = 1 octal digit |
| Binary → Hex | Group binary into 4-bit chunks from right → each chunk = 1 hex digit |
| Octal → Binary | Replace each octal digit with its 3-bit binary equivalent |
| Hex → Binary | Replace each hex digit with its 4-bit binary equivalent |
| Octal ↔ Hex | Go via binary: expand, then regroup (3-bit ↔ 4-bit) |
| Any other pair | Two-step via decimal (always works) |
- How Base Conversion Works — Detailed Notes — Full algorithm explanation with worked examples and shortcut table
- Base Conversion Formula Reference — Positional notation and division algorithm with variables
Frequently Asked Questions
What is a 'base' or 'radix' in a number system?
The base (also called radix) is the number of unique digits the system uses. Base-2 (binary) uses two digits; base-10 (decimal) uses ten; base-16 (hex) uses sixteen. The base determines how quickly the digit positions increase in value: each position is worth base times more than the one to its right.
Why do computers use binary instead of decimal?
Digital circuits have two stable states: on (1) and off (0). Binary maps perfectly to these states. Implementing 10 stable voltage levels for decimal would be far more complex, expensive, and error-prone than using just two levels. Every decimal calculation a computer does is ultimately carried out in binary.
What is the fastest way to convert between binary and hexadecimal?
Group binary bits into sets of 4 from right to left (pad with leading zeros if needed), then replace each group directly with its hex digit from a lookup table. For example, 11010111₂ → 1101 | 0111 → D | 7 = D7₁₆. This takes seconds without any arithmetic.
Can bases larger than 16 be used?
Yes. Base-32, base-36, and base-64 are all used in computing. Base-64, for example, encodes binary data as printable text and is used in email attachments and web tokens. Bases above 16 need additional digit symbols beyond F — typically more letters of the alphabet.