Exact BigInt conversionReviewed 29 Sep 2026Runs in your browser

Number Base Converter

Convert a whole or fractional number between any two bases from 2 to 36 — binary, octal, decimal, hexadecimal or a custom radix — with the positional-notation expansion and a quick-reference row for every common base.

Who wrote it

Written by Suhaib Hassan. Every conversion is re-derived digit by digit. Our methodology.

How the engine works

The integer part converts by repeated division; the fractional part converts by repeated multiplication — both done with exact BigInt fractions, not floating point, so long digit strings stay exact.

Why we built it

It shows every common base at once, so you can spot-check a hex color code or a binary flag against its decimal value instantly.

Convert between bases

Presets
Converting—
Result—
—

—

Decimal value—
Positional expansion—

Quick reference — every common base

The same value shown in binary, octal, decimal and hexadecimal.

—

Step-by-step working

—

—

    Worked examples

    Decimal to binary

    Convert 255 to binary.

    255 ÷ 2 repeatedly: remainders read bottom-up
    255 = 11111111₂

    Hex to decimal

    Convert 0xDEADBEEF to decimal.

    D×16⁷+E×16⁶+…+F×16⁰
    0xDEADBEEF = 3,735,928,559

    Fractional part

    Convert 42.625 to binary.

    42 = 101010₂; 0.625 × 2 repeatedly gives .101₂
    42.625 = 101010.101₂

    How base conversion works

    • Integer part, any base → decimal: multiply each digit by its place value (baseᵏ) and sum.
    • Decimal → any base: repeatedly divide by the target base; the remainders, read from last to first, are the digits.
    • Fractional part → any base: repeatedly multiply the fraction by the target base; the integer part produced each time is the next digit.

    By Suhaib Hassan · Reviewed 29 September 2026 · How CalculatePilot verifies formulas →

    Sources

    • Knuth, D. E. (1997). The Art of Computer Programming, Vol. 2 (3rd ed.), section 4.4 (radix conversion).
    • ISO 80000-2:2019, clause 13 (positional number systems).

    Frequently asked questions

    Why do some fractions never terminate in another base?

    A fraction terminates in base b exactly when its reduced denominator's only prime factors are also prime factors of b. 0.1 (1/10) terminates in decimal but repeats forever in binary, because 5 is not a factor of 2 — the same reason 1/3 repeats in decimal.

    What digits does a base above 10 use?

    After 9, letters continue the sequence: A=10, B=11, … up to Z=35, allowing bases up to 36. Hexadecimal (base 16) uses 0–9 and A–F.

    Why is base 16 so common in computing?

    Each hex digit represents exactly 4 binary bits, so a byte is always exactly 2 hex digits — a much more compact and readable way to write binary data, used for memory addresses, color codes and more.

    How large a number can this handle?

    The integer part supports arbitrarily many digits (exact BigInt arithmetic); the fractional part is computed to 20 digits in the target base, noting if the expansion is truncated rather than exact.

    What's the difference between octal and hexadecimal?

    Both are shorthand for binary: octal (base 8) groups bits in 3s, hexadecimal (base 16) groups them in 4s. Hex is more common today because it aligns with 8-bit bytes; octal remains in use for Unix file permissions.

    Related calculators

    Continue with number bases.

    All Math Calculators

    Embed This Base Converter

    Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

    <iframe src="https://www.calculatepilot.com/embed/number-base-converter.html" width="100%" height="560" loading="lazy" title="Number Base Converter"></iframe>
    For website owners

    Want this calculator on your own website?

    Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

    • All 159 calculators, unlimited embeds
    • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
    • Runs in your visitor's browser, so nothing is sent to a server
    • License key emailed automatically after checkout, cancel anytime
    $7.99 / month
    or $89.99 / year · white-label Pro
    Get the white-label license Embed free with attribution