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…

SystemBaseDigits usedPosition weights (right to left)
Binary20, 11, 2, 4, 8, 16, 32, 64, 128, …
Octal80–71, 8, 64, 512, 4096, …
Decimal100–91, 10, 100, 1000, 10000, …
Hexadecimal160–9, A–F1, 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÷ 16QuotientRemainder
252÷ 1615C (12)
15÷ 160F (15)
Read bottom to top: F, C → (374)₈ = (FC)₁₆. Check: 15×16 + 12 = 252 ✓

Shortcut Conversions (Skip the Decimal Step)

For conversions involving binary, octal, and hex, direct bit-grouping methods are faster than going via decimal.

ConversionShortcut method
Binary → OctalGroup binary into 3-bit chunks from right → each chunk = 1 octal digit
Binary → HexGroup binary into 4-bit chunks from right → each chunk = 1 hex digit
Octal → BinaryReplace each octal digit with its 3-bit binary equivalent
Hex → BinaryReplace each hex digit with its 4-bit binary equivalent
Octal ↔ HexGo via binary: expand, then regroup (3-bit ↔ 4-bit)
Any other pairTwo-step via decimal (always works)

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.