Binary to Decimal Converter

Convert any integer between binary, octal, decimal, and hexadecimal instantly with exact BigInt precision — with step-by-step positional math.

Cross-Base Number Conversion

Live Conversion Results

Binary (base 2)

Octal (base 8)

Decimal (base 10)

Hexadecimal (base 16)

Conversion Detail Steps

Waiting for input…

How Number-Base Conversion Works

Learn the positional notation math behind binary, octal, decimal, and hex — and why exact BigInt arithmetic matters for large integers.

The Positional Notation Formula

Every base-b number is a weighted sum of its digits: N = Σ (digit × b^position), counting positions from the right starting at 0. The decimal number 255 is 2×10² + 5×10¹ + 5×10⁰. The same value in binary, 11111111, is 1×2⁷ + 1×2⁶ + … + 1×2⁰ = 255. Converting between bases is simply re-expressing the same quantity in a different weighted sum.

Base Relationships & BigInt Precision

Because 8 = 2³ and 16 = 2⁴, octal digits map to 3-bit groups and hex digits to 4-bit groups — making binary, octal, and hex trivially interchangeable by chunking. Decimal is the odd one out because 10 is not a power of two. JavaScript's native Number is a 64-bit float that rounds integers above 2⁵³ − 1, so this tool performs every parse and re-emit with BigInt, keeping values like a 128-bit IPv6 address or a 1024-bit RSA modulus bit-perfect.

Troubleshooting & Edge-Case Failure Points

  • Invalid digits: each base only accepts its own digit set — binary accepts only 0 and 1, octal only 0–7, hex only 0–9 and A–F. A stray "9" in an octal string is rejected with a clear error.
  • Prefixes: typing "0x1F" or "0b101" into the value field fails validation because the base selector already sets the radix. Enter only the plain digits of the selected base.
  • Negative numbers: a leading minus sign is honored and carried into every representation. Two's-complement encodings (the fixed-width bit pattern) are a separate concept from plain negative values.
  • Very large integers: values beyond 2⁵³ − 1 are handled exactly with BigInt; a note appears so you know no float rounding has occurred.
  • Whitespace and case: leading/trailing spaces are trimmed automatically and hex digits are case-insensitive on input, uppercased on output.

Step-by-Step Instructions

  1. Pick the input base from the dropdown — binary, octal, decimal, or hexadecimal.
  2. Type (or paste) the integer using only valid digits for that base; an optional leading minus sign is allowed.
  3. Watch all four representations update live, grouped by 4 (binary/hex) or 3 (octal/decimal) digits for readability.
  4. Review the positional expansion and sum in the "Conversion Detail Steps" panel to verify the math by hand.
  5. Copy any single representation with its Copy button, or copy all four at once with the primary button.

How to Use the Binary ⇄ Decimal Converter

Converts binary, octal, decimal, and hex with exact BigInt math and step-by-step expansion — no floating-point surprises.

  1. Type in any base field — all others update live and exactly.
  2. Use the step display to see the positional expansion, ideal for learning.
  3. Paste arbitrarily large values: BigInt math avoids the 2⁵³ float cliff.

Positional Notation and the Exactness Trick

1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11₁₀

Every base is positional: 1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 11₁₀; hex maps cleanly because 16 = 2⁴ (exactly one hex digit per 4 bits — F = 1111). The subtle bug in most converters: JavaScript's standard Number is an IEEE-754 double, and integers above 2⁵³ = 9,007,199,254,740,992 lose exactness silently — this tool uses BigInt so a 40-digit binary string converts correctly. The bases worth knowing by role: binary (machine truth), hex (binary with better readability — every byte = 2 digits), octal (legacy Unix file permissions), decimal (human). Conversion is pure arithmetic — but 0.1 + 0.2 ≠ 0.3 in floats is the adjacent lesson that bites everyone once.

Binary ⇄ Decimal Converter FAQ

Why does my converter show wrong answers for big numbers?

Standard floats lose integer precision above 2^53. This tool uses BigInt arithmetic - every size converts exactly.

How do I convert binary to hex quickly?

Group bits in 4s from the right: 1011 1111 = B F. Each group maps to exactly one hex digit.

Why do computers use binary?

Two states are the cheapest to distinguish reliably in hardware - voltage above/below threshold. Everything else builds up from that bit.

Deep-dive guides