Binary Converter

Type a number in binary, decimal, hex or octal and read it in every other base at once, with the working shown step by step.

Binary

Base 2: the digits 0 and 1.

Decimal

Base 10: the everyday digits 0 to 9.

Hex

Base 16: 0 to 9, then A to F.

Octal

Base 8: the digits 0 to 7.

Base 36

0 to 9, then A to Z.

Try

8 bits, unsigned. Press a bit to flip it.

Type a number in any box to see it in every other base.

Working

Each step shows here once there is a number: place values, divisions or groups of bits.

About this number

Bits needed
Not yet
Bytes
Not yet
Character
Not yet
Bit width

Auto uses as many bits as the number needs. A set width pads with zeros and holds its range.

Negative numbers
Minus signTwo's complement

−5 stays −101 in binary. Pick Two's complement to see how a computer stores it.

Binary, hex and decimal table

Every number from 0 to 255 in binary, hex and octal, with its character. Press a number to convert it.

0 to 150 to 1270 to 255
Numbers 0 to 255 in decimal, binary, hex and octal
DecimalBinaryHexOctalCharacter
0000 0000000NUL
0000 0001011Control
0000 0010022Control
0000 0011033Control
0000 0100044Control
0000 0101055Control
0000 0110066Control
0000 0111077Bell
0000 10000810Backspace
0000 10010911Tab
0000 10100A12Line feed
0000 10110B13Control
0000 11000C14Control
0000 11010D15Carriage return
0000 11100E16Control
0000 11110F17Control
0001 00001020Control
0001 00011121Control
0001 00101222Control
0001 00111323Control
0001 01001424Control
0001 01011525Control
0001 01101626Control
0001 01111727Control
0001 10001830Control
0001 10011931Control
0001 10101A32Control
0001 10111B33Escape
0001 11001C34Control
0001 11011D35Control
0001 11101E36Control
0001 11111F37Control
0010 00002040Space
0010 00012141!
0010 00102242"
0010 00112343#
0010 01002444$
0010 01012545%
0010 01102646&
0010 01112747'
0010 10002850(
0010 10012951)
0010 10102A52*
0010 10112B53+
0010 11002C54,
0010 11012D55-
0010 11102E56.
0010 11112F57/
0011 000030600
0011 000131611
0011 001032622
0011 001133633
0011 010034644
0011 010135655
0011 011036666
0011 011137677
0011 100038708
0011 100139719
0011 10103A72:
0011 10113B73;
0011 11003C74<
0011 11013D75=
0011 11103E76>
0011 11113F77?
0100 000040100@
0100 000141101A
0100 001042102B
0100 001143103C
0100 010044104D
0100 010145105E
0100 011046106F
0100 011147107G
0100 100048110H
0100 100149111I
0100 10104A112J
0100 10114B113K
0100 11004C114L
0100 11014D115M
0100 11104E116N
0100 11114F117O
0101 000050120P
0101 000151121Q
0101 001052122R
0101 001153123S
0101 010054124T
0101 010155125U
0101 011056126V
0101 011157127W
0101 100058130X
0101 100159131Y
0101 10105A132Z
0101 10115B133[
0101 11005C134\
0101 11015D135]
0101 11105E136^
0101 11115F137_
0110 000060140`
0110 000161141a
0110 001062142b
0110 001163143c
0110 010064144d
0110 010165145e
0110 011066146f
0110 011167147g
0110 100068150h
0110 100169151i
0110 10106A152j
0110 10116B153k
0110 11006C154l
0110 11016D155m
0110 11106E156n
0110 11116F157o
0111 000070160p
0111 000171161q
0111 001072162r
0111 001173163s
0111 010074164t
0111 010175165u
0111 011076166v
0111 011177167w
0111 100078170x
0111 100179171y
0111 10107A172z
0111 10117B173{
0111 11007C174|
0111 11017D175}
0111 11107E176~
0111 11117F177Delete
1000 000080200Control
1000 000181201Control
1000 001082202Control
1000 001183203Control
1000 010084204Control
1000 010185205Control
1000 011086206Control
1000 011187207Control
1000 100088210Control
1000 100189211Control
1000 10108A212Control
1000 10118B213Control
1000 11008C214Control
1000 11018D215Control
1000 11108E216Control
1000 11118F217Control
1001 000090220Control
1001 000191221Control
1001 001092222Control
1001 001193223Control
1001 010094224Control
1001 010195225Control
1001 011096226Control
1001 011197227Control
1001 100098230Control
1001 100199231Control
1001 10109A232Control
1001 10119B233Control
1001 11009C234Control
1001 11019D235Control
1001 11109E236Control
1001 11119F237Control
1010 0000A0240No-break space
1010 0001A1241¡
1010 0010A2242¢
1010 0011A3243£
1010 0100A4244¤
1010 0101A5245¥
1010 0110A6246¦
1010 0111A7247§
1010 1000A8250¨
1010 1001A9251©
1010 1010AA252ª
1010 1011AB253«
1010 1100AC254¬
1010 1101AD255Soft hyphen
1010 1110AE256®
1010 1111AF257¯
1011 0000B0260°
1011 0001B1261±
1011 0010B2262²
1011 0011B3263³
1011 0100B4264´
1011 0101B5265µ
1011 0110B6266
1011 0111B7267·
1011 1000B8270¸
1011 1001B9271¹
1011 1010BA272º
1011 1011BB273»
1011 1100BC274¼
1011 1101BD275½
1011 1110BE276¾
1011 1111BF277¿
1100 0000C0300À
1100 0001C1301Á
1100 0010C2302Â
1100 0011C3303Ã
1100 0100C4304Ä
1100 0101C5305Å
1100 0110C6306Æ
1100 0111C7307Ç
1100 1000C8310È
1100 1001C9311É
1100 1010CA312Ê
1100 1011CB313Ë
1100 1100CC314Ì
1100 1101CD315Í
1100 1110CE316Î
1100 1111CF317Ï
1101 0000D0320Ð
1101 0001D1321Ñ
1101 0010D2322Ò
1101 0011D3323Ó
1101 0100D4324Ô
1101 0101D5325Õ
1101 0110D6326Ö
1101 0111D7327×
1101 1000D8330Ø
1101 1001D9331Ù
1101 1010DA332Ú
1101 1011DB333Û
1101 1100DC334Ü
1101 1101DD335Ý
1101 1110DE336Þ
1101 1111DF337ß
1110 0000E0340à
1110 0001E1341á
1110 0010E2342â
1110 0011E3343ã
1110 0100E4344ä
1110 0101E5345å
1110 0110E6346æ
1110 0111E7347ç
1110 1000E8350è
1110 1001E9351é
1110 1010EA352ê
1110 1011EB353ë
1110 1100EC354ì
1110 1101ED355í
1110 1110EE356î
1110 1111EF357ï
1111 0000F0360ð
1111 0001F1361ñ
1111 0010F2362ò
1111 0011F3363ó
1111 0100F4364ô
1111 0101F5365õ
1111 0110F6366ö
1111 0111F7367÷
1111 1000F8370ø
1111 1001F9371ù
1111 1010FA372ú
1111 1011FB373û
1111 1100FC374ü
1111 1101FD375ý
1111 1110FE376þ
1111 1111FF377ÿ

Made for computer science homework, binary to denary exam questions and everyday code: each answer lists its place values or its divisions by 2.

Every number is worked out exactly in this tab, even hundreds of digits long, with no sign-up and nothing sent to a server.

  • Binary, decimal, hex and octal
  • Steps for every answer
  • Two's complement to 64 bits

How to convert binary

Type in the box for the base you have, read the others, then follow the working.

  1. Type 1011 in Binary

    Write your number in the box for its base: Binary, Decimal, Hex or Octal. Spaces and a 0x or 0b prefix are fine.

  2. Read every base

    The other boxes fill in as you type: 1011 in binary is 11 in decimal, B in hex and 13 in octal, each ready to copy.

  3. Follow the steps

    The Working lists each digit times its place value, or each division by 2, to check an answer or learn the method.

How to convert binary to decimal

Each place in a binary number is worth twice the place to its right: 1, 2, 4, 8, 16, 32 and so on, counting from the right. To convert binary to decimal, write those place values over the digits and add up the ones that sit over a 1. UK schools call this binary to denary.

Take 101101. From the left its places are worth 32, 16, 8, 4, 2 and 1. The 1s sit under 32, 8, 4 and 1, so the number is 32 + 8 + 4 + 1 = 45. A binary number that ends in 1 is always odd, which makes a quick check on any answer.

The method works in any base: multiply each digit by its place value, then add. The Working above gives every digit its own line, zeros included, and puts the sum last, the way a teacher asks you to show it.

How to convert decimal to binary

Divide the number by 2 and write down the remainder, which is always 0 or 1. Divide the answer by 2 again, and keep going until you reach 0. The remainders, read from the last one back up to the first, are the number in binary.

For 45: 45 ÷ 2 = 22 r 1, 22 ÷ 2 = 11 r 0, 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0 and 1 ÷ 2 = 0 r 1. Reading the remainders up from the bottom gives 101101. Divide by 16 instead and you get hex digits; divide by 8 and you get octal.

A number with a point converts in two halves. The part after the point is multiplied by 2 again and again, and each whole part is the next digit: 0.625 gives 1, 0, 1, so 2.625 is 10.101. Some decimals, like 0.1, never end in binary, and the tool shows which digits repeat.

How to convert hex to decimal and back

Hexadecimal, or hex, counts in sixteens. After 0 to 9 come A to F for 10 to 15, and each place is worth 16 times the one to its right: 1, 16, 256, 4,096. So 2AF is 2 × 256 + 10 × 16 + 15 = 687, and FF is 255, the largest number one byte can hold.

To go from decimal to hex, divide by 16 and write each remainder as a hex digit, just as you divide by 2 for binary. 687 ÷ 16 = 42 r 15 (F), 42 ÷ 16 = 2 r 10 (A) and 2 ÷ 16 = 0 r 2, which reads up as 2AF.

Hex and binary line up exactly: every hex digit is four bits. Split a binary number into groups of four from the right and swap each group for its digit, so 1111 1101 1010 is FDA. Octal works the same way with groups of three. Colour codes such as #FF8000 are hex too.

Two's complement and negative binary numbers

Computers store a negative whole number as its two's complement. Write the positive number in the bits you have, flip every bit, then add 1. In 8 bits, 5 is 00000101; flipped it is 11111010, and adding 1 gives 11111011, which is how −5 is stored.

The top bit gives the sign: 0 for zero or more, 1 for negative. That is why 8 bits hold −128 to 127 rather than 0 to 255, and why 11111011 reads as 251 unsigned but −5 signed. To read a pattern back, flip the bits and add 1 again.

The width matters, so set it under Bit width: −5 is FB in 8 bits, FFFB in 16 and FFFFFFFB in 32. With Negative numbers set to Two's complement, digits typed in binary, hex or octal are read as a pattern, so 11111011 comes back as −5.

A binary calculator and base converter

  • Binary calculator

    Add, subtract, multiply or divide in binary, hex, octal or decimal, with carries shown as on paper.

  • Bitwise AND, OR, XOR

    Run AND, OR or XOR on two numbers, or shift one left or right, with every bit lined up in columns.

  • Two's complement

    Pick 8, 16, 32 or 64 bits: negative numbers are written as two's complement and read back from it.

  • Any base, 2 to 36

    A fifth box converts to and from any base from 2 to 36. Base 36 uses the digits 0 to 9 and A to Z.

  • Binary fractions

    Numbers with a point convert too: binary 10.101 is 2.625, and 0.1 shows which binary digits repeat.

  • Flip binary bits

    Every bit of the number is a button. Click one to flip it between 0 and 1 and each base updates.

A free binary converter, nothing sent

Every conversion runs in this browser tab, so no number you type leaves your device.

  • Processing

    Numbers are converted by code running in this tab, however long. No digit you type is sent online.

  • Storage

    Only settings such as the bit width are kept in this browser. Reload and the number boxes are empty.

  • Account

    No account, no email and no daily cap: convert one number or a whole worksheet of them for free.

Binary questions, answered

What is the binary number system?

A way of writing numbers with only two digits, 0 and 1. Each place is worth twice the one to its right, so 101 means 4 + 1 = 5.

How many bits are in a byte?

Eight. One byte holds 00000000 to 11111111 in binary, which is 0 to 255 in decimal or 00 to FF in hex.

What is 10 in binary?

1010: one 8, no 4, one 2 and no 1, so 8 + 2 = 10. Read as binary, 1010 is ten, not one thousand and ten.

What is 255 in binary?

11111111, eight 1s: 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1. It is the largest number one byte holds, FF in hex.

What is hexadecimal?

A base 16 number system using 0 to 9 and A to F. One hex digit stands for four bits, so code uses it to write bytes short.

How to read binary numbers?

Number the places from the right as 1, 2, 4, 8 and so on, doubling each time, and add those holding a 1: 1101 is 8 + 4 + 1 = 13.

Why do computers use binary?

A circuit only has to tell two states apart, on or off. That is far more reliable than telling ten levels of voltage apart.

How do you convert binary to denary?

Denary is the UK school name for decimal. Add the place values under each 1: 0100 0110 is 64 + 4 + 2 = 70.

Still stuck, or found a problem? Email dobliquestudio@gmail.com and we will help.