Skip to content
JustTools

Number Base Converter

Binary, octal, decimal, hex or any base — converted instantly, with every step explained.

Runs in your browser Free · no sign-up

At a glance

  • Converts between binary, octal, decimal and hexadecimal at once, plus any base from 2 to 36.
  • Exact for whole numbers of any size — hundreds of digits — and for fractions, where repeating digits are shown in brackets: 0.1 in binary is 0.0(0011).
  • Shows the working the way it’s taught: place values to convert to decimal, repeated division (remainders read bottom-up) and repeated multiplication for fractions.
  • Shows integers in two’s complement for 8, 16, 32 and 64 bits, and reads a binary pattern back as a signed number.
  • Breaks a number into the IEEE 754 sign, exponent and mantissa for 32-bit floats and 64-bit doubles, and shows the value actually stored.
  • Accepts 0b, 0o and 0x prefixes, spaces and underscores, and groups digits for easy reading.

Step by step

How to convert between number bases

  1. 1

    Type the number

    Enter it in any base — 0x or 0b prefixes, spaces and underscores are fine.

  2. 2

    Choose its base

    Binary, octal, decimal, hexadecimal or another base from 2 to 36.

  3. 3

    Read every base

    The number appears in all the common bases at once; copy any of them.

  4. 4

    Follow the steps

    Pick a target base to see the division or multiplication working.

Features

Everything you need, nothing you don’t

All bases at once

Binary, octal, decimal, hex and base 2–36.

Step by step

Division, multiplication and place values.

Fractions

Exact, with repeating digits found.

Any size

Big integers, no rounding.

Two’s complement

8, 16, 32 and 64 bits.

IEEE 754

Float and double bits.

How to convert decimal to binary

Divide the number by 2 again and again, writing down each remainder, until the quotient is 0. The remainders read from the bottom up are the binary number. For 13: 13 ÷ 2 = 6 r 1, 6 ÷ 2 = 3 r 0, 3 ÷ 2 = 1 r 1, 1 ÷ 2 = 0 r 1 — so 13 is 1101. To go back, multiply each digit by its place value and add: 1×8 + 1×4 + 0×2 + 1×1 = 13. The same method works for any base: divide by 8 for octal, by 16 for hex.

Common values

DecimalBinaryOctalHex
10101012A
15111117F
161 00002010
100110 010014464
2551111 1111377FF
1024100 0000 00002000400

FAQ

Frequently asked questions

How do I convert binary to decimal?

Multiply each digit by 2 raised to its position (counting from 0 on the right) and add the results. 101101 = 32 + 8 + 4 + 1 = 45.

How do I convert hex to decimal?

Each hex digit is worth 16 times the one to its right; A–F stand for 10–15. 1F4 = 1×256 + 15×16 + 4 = 500.

Why does 0.1 never end in binary?

Only fractions whose denominator is a power of 2 end in binary. 0.1 = 1/10 repeats for ever (0.0001100110011…), which is why computers store 0.1 slightly inaccurately.

What is two’s complement?

The way computers store negative integers: invert all the bits of the positive number and add 1. In 8 bits, −1 is 11111111 and −128 is 10000000.

What bases are supported?

Any base from 2 to 36, using the digits 0–9 and then the letters a–z.

Is there a size limit?

No practical limit for whole numbers — conversion uses exact big-integer arithmetic. Fractions are shown up to 48 digits after the point.

Keep going

Browse every tool

Last updated Report a problem or suggest a feature