Base Converter
Convert any base 2–36 to any other base instantly — binary, octal, decimal, hexadecimal and beyond. Free, fast, no sign-up.
Invalid digit for the selected base — check your input and try again.
Conversion steps
| Digit | Position | Value | Contribution |
|---|
Also equals
- Binary
- Decimal
- Octal
- Hex
How to convert between number bases
- Write down the number and number each digit's position from right to left, starting at 0.
- Convert each digit to its value (0–9 stay 0–9; A–Z mean 10–35) and multiply by the base raised to its position.
- Add all the results — that's the decimal value. To reach another base, repeatedly divide by the target base and read the remainders from bottom to top.
Example: FF₁₆ = (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255₁₀.
Background reading: radix and positional notation on Wikipedia.
Digit values (bases up to 36)
| Digit | Value | Digit | Value | Digit | Value |
|---|---|---|---|---|---|
0 | 0 | 1 | 1 | 2 | 2 |
3 | 3 | 4 | 4 | 5 | 5 |
6 | 6 | 7 | 7 | 8 | 8 |
9 | 9 | A | 10 | B | 11 |
C | 12 | D | 13 | E | 14 |
F | 15 | G | 16 | H | 17 |
I | 18 | J | 19 | K | 20 |
L | 21 | M | 22 | N | 23 |
O | 24 | P | 25 | Q | 26 |
R | 27 | S | 28 | T | 29 |
U | 30 | V | 31 | W | 32 |
X | 33 | Y | 34 | Z | 35 |
Base conversion in code
Python
int("ff", 16) # → 255 (any base 2–36)
def to_base(n, b):
digits = "0123456789abcdefghijklmnopqrstuvwxyz"
if n == 0:
return "0"
out = ""
while n > 0:
out = digits[n % b] + out
n //= b
return out
to_base(255, 16) # → 'ff'
JavaScript
parseInt("ff", 16); // → 255 (any base 2–36)
(255).toString(16); // → "ff" (any base 2–36)
C
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("%ld\n", strtol("ff", NULL, 16)); /* → 255 */
return 0;
}
Real-world applications
- Reading hex color codes (#FF5733), memory addresses and error codes in programming.
- Understanding file permissions (octal, e.g. chmod 755) and Unix modes.
- Shortening IDs and URLs with base 36 or base 62 encodings.
- Learning how positional number systems work — the foundation of computer arithmetic.
Common mistakes
- Using a digit the base doesn't allow — e.g. "2" is invalid in binary, "G" is invalid in hex.
- Forgetting that A–Z count as 10–35, not as letters with their alphabet position.
- Reading remainders top-down instead of bottom-up when dividing into the new base.
Common values
FF₁₆ = 255₁₀1010₂ = 10₁₀777₈ = 511₁₀100₃₆ = 1296₁₀ZZ₃₆ = 1295₁₀ (largest 2-digit base-36 value)0= 0 in every base
Key takeaways
- Every base works the same way: digit × baseposition, summed.
- Digits run 0–9 then A–Z for values 10–35; base 36 is the largest supported.
- Convert via decimal as the middle step, or let the tool do it directly.
- 0x, 0b and 0o prefixes plus spaces, commas and underscores are accepted.
- Big bases like 36 keep numbers short — handy for compact IDs.
Frequently asked questions
How do I convert between any two number bases?
Convert to decimal first: multiply each digit by the base raised to its position power and sum the results. Then convert the decimal value to the target base by repeated division, reading the remainders bottom-up. The converter above does both steps instantly.
What number bases does this converter support?
Any base from 2 (binary) to 36, using digits 0–9 and letters A–Z for values 10–35.
How do I convert FF from hexadecimal to decimal?
FF in hex = 15 × 16 + 15 = 255 in decimal.
What is 100 in base 36?
100 in decimal = 2S in base 36 (2 × 36 + 28 = 100, and 28 is written S).
Can I use prefixes like 0x or 0b?
Yes — 0x, 0b and 0o prefixes are recognized for hex, binary and octal inputs, and spaces, commas, underscores and dashes are ignored.
Why does base 36 use letters?
Beyond digit 9, bases use letters A–Z for values 10–35. Base 36 uses all of them, which makes numbers short — handy for compact IDs and URL shorteners.
Can this converter handle very large numbers?
Yes — it uses arbitrary-precision arithmetic, so inputs hundreds of digits long convert with no overflow or rounding.
What is the largest digit in base 16?
F, worth 15. In any base, the largest digit is always one less than the base.
Need a specific pair? Try our hex to decimal or binary to decimal converters.
More converters
From the blog
-
How to Convert Binary to Decimal (Step-by-Step with Examples)
The positional method, worked examples (1010, 11111111, 10101010), a left-to-right shortcut, and the mistakes everyone makes at first.
-
Hexadecimal Explained: From 0xFF to Color Codes Like #FF5733
What hex is, how to read values like 0xFF and 2F, and a complete walkthrough of #FF5733 — plus where else hex shows up in computing.
-
How to Convert Text to Binary (UTF-8 Explained)
The three-step pipeline from characters to code points to bytes to bits, with worked examples and why “8 bits per character” is a myth.
Add this converter to your website
Embed our free base converter on your own site with one line of code:
<script src="https://binary-to-decimal-28z.pages.dev/embed.js"></script>
For developers
Converting bases in your own app? Use our free BinDec JavaScript API — one function call, any base 2–36, arbitrary precision.