Math · free · step by step

Binary Converter

Type in any box to convert between binary, decimal, hex, octal and any base from 2 to 36. Big numbers and fractions convert exactly, with the steps, two’s complement and how a float is stored.

Step by step

Two’s complement bits

Click a bit to flip it.

IEEE 754 floating point

Chart

Decimal, binary, octal and hex from 0 to 16

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

Worked examples

Conversion examples

More math

Other math tools

Questions

Binary Converter FAQ

Free, private and works offline: everything is worked out in your browser.

How do you convert decimal to binary?

Divide by 2 again and again and write down the remainders, then read them from the bottom up. 156 ÷ 2 = 78 r 0, 78 ÷ 2 = 39 r 0, and so on until you reach 0; reading the 8 remainders upward gives 10011100.

How do you convert binary to decimal?

Multiply each bit by its place value (1, 2, 4, 8, 16… from the right) and add: 10110110 = 128 + 32 + 16 + 4 + 2 = 182.

How do you convert hex to binary and back?

Each hex digit is exactly four bits, so swap digit for group: 2F = 0010 1111, and 1011 0110 = B6. Octal works the same way with groups of three bits.

How do I convert hex to decimal?

Multiply each digit by a power of 16 (A = 10 … F = 15) and add: FF = 15 × 16 + 15 = 255, and 7E3 = 2019.

What is two’s complement?

It is how computers store negative whole numbers. Write the positive value in binary, flip every bit, then add 1: in 8 bits, 5 is 00000101, flipped is 11111010, and adding 1 gives 11111011 (hex FB) for −5. Click any bit in the converter to flip it and see the number change.

How are decimals like 0.1 stored in binary?

0.1 has no exact binary form: it is 0.00011… with 0011 repeating. A 32-bit float stores the nearest value, 0.100000001490116119384765625, as hex 3DCCCCCD; that small error is why 0.1 + 0.2 isn’t exactly 0.3 in most programming languages.

Can it convert very large numbers and other bases?

Yes. Whole numbers of any length convert exactly, and the “Other base” field works with any base from 2 to 36 (digits 0–9 then A–Z). Fractions convert too, with repeating digits shown in brackets.

Is the binary converter free and private?

Yes. Everything runs in your browser and nothing you type is sent anywhere. The link updates as you type so you can share a conversion.

Built and maintained by Zubaer Ahammed · Updated · Runs on your device; nothing you add is uploaded