Number Base Converter
Convert any integer between number bases 2 through 36 — binary, octal, decimal, hexadecimal, and beyond. Enter the number and choose the source and target base.
Inputs
Results
What "Base" Really Means
Every whole number can be written using a positional notation system. The base (or radix) tells you how many distinct digit symbols you use, and how much each position is worth.
In our everyday base 10 system, we use ten digits (0–9), and each position is ten times the one to its right:
3,472=3×103+4×102+7×101+2×100Switch the base to 2 (binary) and you only get two digits (0 and 1), and each position doubles:
10112=1×23+0×22+1×21+1×20=1110That is the entire idea. Different bases are just different ways of writing the same underlying integer.
The Four Bases You Will See Most Often
| Base | Name | Digits | Used for |
|---|---|---|---|
| 2 | Binary | 0, 1 | How computers store everything internally |
| 8 | Octal | 0–7 | Unix file permissions (e.g. chmod 755), legacy systems |
| 10 | Decimal | 0–9 | Human everyday counting |
| 16 | Hexadecimal | 0–9, A–F | Memory addresses, color codes (#FF8800), byte values |
For bases above 10, we need extra digit symbols. The convention is to use the letters of the alphabet: A = 10, B = 11, … all the way up to Z = 35. That is why this calculator supports bases 2 through 36 — 36 is the largest base you can write with 0–9 plus A–Z.
Converting by Hand: Base X → Base 10
To convert a number from any base to decimal, multiply each digit by the base raised to the power of its position (counting from 0 on the right) and add them up.
Convert FF (hex) to decimal:
Convert 1010 (binary) to decimal:
Convert 377 (octal) to decimal:
Notice that FF₁₆ and 377₈ both equal 255₁₀. They are three different written representations of the same number.
Converting by Hand: Base 10 → Base X
To go the other direction, repeatedly divide by the target base and collect the remainders. Read the remainders bottom to top to get the converted number.
Convert 255₁₀ to base 16:
| Step | Dividend | ÷ 16 | Remainder |
|---|---|---|---|
| 1 | 255 | 15 | 15 → F |
| 2 | 15 | 0 | 15 → F |
Read bottom-up: FF. ✓
Convert 10₁₀ to base 2:
| Step | Dividend | ÷ 2 | Remainder |
|---|---|---|---|
| 1 | 10 | 5 | 0 |
| 2 | 5 | 2 | 1 |
| 3 | 2 | 1 | 0 |
| 4 | 1 | 0 | 1 |
Read bottom-up: 1010. ✓
The "go through decimal" trick works for converting between any two bases: convert source → decimal → target. That is exactly what this calculator does internally.
A Shortcut: Binary ↔ Octal ↔ Hex
Because 8 = 2³ and 16 = 2⁴, you can convert between binary and these two bases just by grouping digits. No division required.
Binary → Octal: group the binary digits in threes from the right and convert each group to a single octal digit.
2010510171112=2578Binary → Hex: same trick, but group in fours.
A1010F11112=AF16This is why programmers gravitate to hex when reading raw byte dumps — every two hex digits map to exactly one byte (8 bits = 2 × 4-bit groups).
Where You Will Actually Use This
Programming and debugging
- Hex color codes in CSS and design tools:
#FF8800means R =FF(255), G =88(136), B =00(0). - Memory addresses in debuggers, stack traces, and disassemblers are always shown in hex (
0x7fff8a3b0c40). - Bit masks and flags are often easier to read in binary or hex than decimal, because each digit corresponds to specific bit positions.
- File permissions on Unix systems use three octal digits:
chmod 755 script.shmeans owner has read+write+execute (7), group and others have read+execute (5).
Embedded systems and electronics
Microcontroller registers, GPIO pin configurations, and hardware datasheets are written in hex or binary because every bit usually has a specific meaning. Converting to decimal would obscure the structure.
Cryptography and hashing
Hashes like SHA-256 and MD5 are 256-bit and 128-bit values that would be unreadable in decimal. They are universally displayed in hex.
Encoding and serialization
Base64 (which actually uses 64 symbols, going past A–Z into a–z, 0–9, +, and /) is built on the same principles, just with a larger digit set than this calculator supports.
Edge Cases to Know
- Zero is the same in every base.
0,0₂,0₁₆,0₃₆all represent the same value. - Single-digit numbers up to the base − 1 stay identical.
7in base 8, 10, and 16 is the same7. But8is valid in decimal and hex but invalid in octal — that is what the input-validation error in this calculator catches. - Case does not matter for letter digits.
FF,Ff, andffall mean the same hex value 255. This calculator accepts any combination. - Negative numbers and fractions are not handled here — this is an integer-only converter. Computers represent negatives using two's complement, which is a different topic.
Try It
Punch in FF with from base 16 and to base 2 — you should get 11111111. That is one byte, all bits set, the largest value a single unsigned 8-bit number can hold. Now try 255 from base 10 to base 16 — back to FF. Same number, three different ways of writing it down.
Recommended Next
Roman Numeral Converter
Convert Roman numerals to Arabic numbers or Arabic numbers to Roman numerals. Supports all standard values from I to MMMCMXCIX (1–3999).
Fraction ↔ Decimal ↔ Percent Converter
Convert between fractions, decimals, and percentages. A value entered in any of the three fields updates the other two equivalent forms.