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.
Free forever · No sign-up
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.
Your data stays in your browser.
| Digit | Position | Value | Contribution |
|---|
No recent conversions yet.
Example: FF₁₆ = (15 × 16¹) + (15 × 16⁰) = 240 + 15 = 255₁₀.
Background reading: radix and positional notation on Wikipedia.
| 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 |
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'
parseInt("ff", 16); // → 255 (any base 2–36)
(255).toString(16); // → "ff" (any base 2–36)
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("%ld\n", strtol("ff", NULL, 16)); /* → 255 */
return 0;
}
FF₁₆ = 255₁₀1010₂ = 10₁₀777₈ = 511₁₀100₃₆ = 1296₁₀ZZ₃₆ = 1295₁₀ (largest 2-digit base-36 value)0 = 0 in every baseConvert 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.
Any base from 2 (binary) to 36, using digits 0–9 and letters A–Z for values 10–35.
FF in hex = 15 × 16 + 15 = 255 in decimal.
Decimal 100 = 2S in base 36 (2 × 36 + 28 = 100, where the digit S stands for 28).
Yes — 0x, 0b and 0o prefixes are recognized for hex, binary and octal inputs, and spaces, commas, underscores and dashes are ignored.
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.
Yes — it uses arbitrary-precision arithmetic, so inputs hundreds of digits long convert with no overflow or rounding.
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.
The positional method, worked examples (1010, 11111111, 10101010), a left-to-right shortcut, and the mistakes everyone makes at first.
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.
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.
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>
Converting bases in your own app? Use our free BinDec JavaScript API — one function call, any base 2–36, arbitrary precision.