Skip to main content
🔢 Number Systems

Number Base Converter

Convert a whole number between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) — see all four forms at once, with the method shown.

Binary & hex
Octal & decimal
All four at once
Input validated
100% Free
🔢 Open All Math Calculators 📖 Read the Guide

Number bases — Quick answer

Each base uses a fixed set of digits; the same value can be written in any of them.

bin 0-1  ·  oct 0-7  ·  dec 0-9  ·  hex 0-9 A-F

Worked example: decimal 255 = binary 11111111 = octal 377 = hex FF.

Base conversion quick reference

DecimalBinaryOctalHex
10101012A
100110010014464
25511111111377FF
5111111111117771FF

One hex digit equals exactly four binary digits — why hex shorthands bytes.

🔢 Number Base Converter

Type a value, choose the base it's written in, and get all four forms.

Decimal (base 10)
Binary (base 2)
Octal (base 8)
Hexadecimal (base 16)

ℹ️ Enter whole numbers only. Hexadecimal uses A–F for 10–15 (case-insensitive). The converter rejects digits that aren't valid for the chosen base.

A number base (or radix) is how many digits a system uses before it rolls over. Binary uses two (0–1), octal eight, decimal ten, and hexadecimal sixteen (0–9 then A–F). The same quantity can be written in any base — decimal 255 is binary 11111111 and hex FF. This converter reads your value in its base and re-expresses it in all four, the everyday currency of computing.

Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: positional notation and radix conversion, recomputed in code.

How base conversion works

To decimal
Σ digit × base^position  (positions from 0, right to left)
From decimal
divide by base repeatedly, read remainders bottom-up
Digit ranges
bin 0–1 · oct 0–7 · dec 0–9 · hex 0–F

Every number is a string of digits weighted by powers of its base. To go to decimal you sum each digit times the base raised to its place. To leave decimal you repeatedly divide by the target base and collect the remainders. Because 16 = 2⁴ and 8 = 2³, hex and octal line up neatly with binary — four bits per hex digit, three per octal digit — which is exactly why programmers reach for them.

Worked example — decimal 255

Scenario: express 255 in every base.

To hex
255 ÷ 16 = 15 r 15 (F), 15 ÷ 16 = 0 r 15 (F) → FF
To binary
255 = 128+64+32+16+8+4+2+1 → 11111111
To octal
255 ÷ 8 = 31 r 7, 31 ÷ 8 = 3 r 7, 3 ÷ 8 = 0 r 3 → 377

Decimal 255 is the largest value a single byte holds, so it maps to all 1s in binary (11111111) and the tidy FF in hex — two hex digits for one byte. Going the other way, binary 1010 sums to 8 + 2 = 10 in decimal, which is A in hex. The converter handles any of these directions and validates that your digits fit the base you chose.

Frequently Asked Questions

How do I convert binary to decimal?

Sum each digit × 2^position (right to left from 0). 1010 = 1×8 + 0×4 + 1×2 + 0×1 = 10.

How do I convert decimal to hexadecimal?

Divide by 16 repeatedly, read remainders bottom-up with A–F. 255 → F, F → FF. So 255 = FF = 11111111.

What digits does each base use?

Binary 0–1, octal 0–7, decimal 0–9, hex 0–9 then A–F (A=10…F=15). Invalid digits are rejected.

Why is hexadecimal used in computing?

One hex digit = four bits, so hex is compact shorthand for binary. A byte is two hex digits (FF = 255); used for colours (#FF8800) and addresses.

What is octal used for?

Mainly Unix/Linux file permissions (chmod 755). Decimal 255 = octal 377; binary 111111111 = octal 777.

Need more math tools?

Explore programmer tools, exponents, modulo, scientific notation and more across the AI Calculator suite.

🔢 Open Math Calculators — Free

No registration required · 350+ calculators · PDF report export