BinaryBase 2 · 0–1
OctalBase 8 · 0–7
DecimalBase 10 · 0–9
input
HexadecimalBase 16 · 0–F

All conversions run locally in your browser.

Four light bulbs, three lit and one off, above the number 13, showing 13 in decimal as 1101 in binary

How to use

  1. Type a number into any of the four boxes: Binary, Octal, Decimal or Hexadecimal.
  2. The other three update as you type. To convert the other way, type in another box, for example in Binary to get decimal.
  3. A red message means a character does not belong to that base, such as a 2 in binary or a G in hex.

How to convert decimal to binary by hand

Divide the number by 2 and write down the remainder (0 or 1). Keep dividing the result by 2 until you reach 0. The binary number is the remainders read from the last one to the first one.

Example with 13: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1. Reading the remainders from the bottom up gives 1101, so 13 in decimal is 1101 in binary.

How to convert binary to decimal

Each binary digit is worth twice as much as the digit to its right: 1, 2, 4, 8, 16, 32 and so on, starting from the right. Add up the values of the positions that hold a 1.

Example with 101101: the 1s sit in the 32, 8, 4 and 1 positions, and 32 + 8 + 4 + 1 = 45. So 101101 in binary is 45 in decimal.

Decimal, binary, octal and hex chart (0 to 16)

Hexadecimal uses the letters A to F for the values 10 to 15. One hex digit always stands for exactly four binary digits, which is why programmers use hex as a short way to write binary: 1111 1111 is FF, and FF is 255.

DecimalBinaryOctalHex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F
16100002010

Where you see these number systems

Binary is how computers store everything, from numbers to photos. Hexadecimal shows up in web colors (#FF8800 is 255 red, 136 green, 0 blue), MAC addresses and error codes. Octal is mostly used for Linux file permissions: chmod 755 means 111 101 101 in binary, which is read, write and execute for the owner and read and execute for everyone else.

Frequently asked questions

Can it convert very large numbers?

Yes. The converter uses JavaScript BigInt, so it handles whole numbers with hundreds of digits exactly, with no rounding. Many calculators lose accuracy above 9,007,199,254,740,991.

Can it convert decimal fractions like 0.5 to binary?

Not yet. It converts whole numbers only. To convert a fraction by hand, multiply the part after the point by 2 and write down the digit before the point each time: 0.625 × 2 = 1.25 (1), 0.25 × 2 = 0.5 (0), 0.5 × 2 = 1.0 (1), so 0.625 is 0.101 in binary.

How are negative numbers shown?

With a minus sign, for example -13 becomes -1101. Computers usually store negative numbers in two's complement instead, where the same value in 8 bits is 11110011. This tool does not produce two's complement output.

Is hex case-sensitive?

No. You can type ff or FF; the result is always shown in capital letters.

Does it work offline?

Yes. Every conversion runs in your browser, so once the page has loaded it works without an internet connection and nothing you type is sent anywhere.

Found a problem or have an idea? Report a problem

Share

You might also like