Converters & translators

Binary Converter — Binary, Decimal, Hex & Octal

Convert between binary, decimal, hexadecimal, and octal as you type — exact for numbers of any size — with two's complement for 8/16/32/64 bits, bit and byte counts, step-by-step working, and a live binary clock.

Updated · Free, no sign-up

6 bits · 1 byte

Signed (two’s complement)

42 = 0010 1010

Show the working for

Decimal → binary: divide by 2

42 ÷ 2= 21remainder 0
21 ÷ 2= 10remainder 1
10 ÷ 2= 5remainder 0
5 ÷ 2= 2remainder 1
2 ÷ 2= 1remainder 0
1 ÷ 2= 0remainder 1

Read the remainders from bottom to top: 101010

Binary → decimal: add the place values

13201618041201

32 + 8 + 2 = 42

Binary clock

Hours00000 = 00
Minutes000000 = 00
Seconds000000 = 00

Share this tool

Know someone who’d love it?

How to use the binary converter

A binary converter changes a number from one number system to another: binary (base 2), decimal (base 10), hexadecimal (base 16), and octal (base 8). Type a number into any box — binary, decimal, hexadecimal, or octal — and the other three update instantly. Prefixes like 0b, 0x, and 0o, spaces, and underscores are all fine. Numbers of any size stay exact, from a single bit to 64-bit values and beyond. Below the boxes you’ll find the two’s complement form for 8, 16, 32, and 64 bits and the full working for each conversion.

Binary to decimal

To convert binary to decimal, write the place values over the bits — 1, 2, 4, 8, 16 … from right to left — and add the place values wherever there’s a 1. Example: 101101 = 32 + 8 + 4 + 1 = 45. The converter shows this sum for every number you type.

Binary, decimal and hex conversion chart

Decimal, binary, hex and octal side by side, with both conversions worked out.

Decimal to binary

To convert decimal to binary, divide by 2 again and again and write down the remainders: 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, 1 ÷ 2 = 0 r 1. Reading the remainders from the bottom up gives 101101. The division table appears under the converter.

Binary to hex and hex to binary

Hexadecimal (base 16) is a shorthand for binary: every hex digit is exactly four bits. To convert binary to hex, split the bits into groups of four from the right and replace each group: 1010 1111 = AF. To go from hex to binary, expand each digit into four bits: 3C = 0011 1100. Tick Group binary in 4s to see the groups.

Binary to octal

Octal (base 8) works the same way with groups of three bits: 110 101 = 65 in octal. It’s still used for Unix file permissions (for example 755).

Hex to decimal

To convert hex to decimal, type the hex number in the Hexadecimal box (with or without 0x) and read the decimal box. Then tap Hex under “Show the working for” to see every digit multiplied out. By hand, give each hex digit its place value, a power of 16 (1, 16, 256, 4,096 … from right to left), turn the letters into numbers (A = 10 up to F = 15), multiply, and add:

2AF = 2 × 256 + 10 × 16 + 15 × 1 = 512 + 160 + 15 = 687

Hex values that come up often, with their decimal and binary values:

Hex to decimal conversion table
HexDecimalBinaryTry it
A101010Open hex A in the converter
F151111Open hex F in the converter
10160001 0000Open hex 10 in the converter
1F310001 1111Open hex 1F in the converter
641000110 0100Open hex 64 in the converter
7F1270111 1111Open hex 7F in the converter
801281000 0000Open hex 80 in the converter
FF2551111 1111Open hex FF in the converter
1002560001 0000 0000Open hex 100 in the converter
3E81,0000011 1110 1000Open hex 3E8 in the converter
4001,0240100 0000 0000Open hex 400 in the converter
FFFF65,5351111 1111 1111 1111Open hex FFFF in the converter

Decimal to hex

To convert decimal to hex, type the number in the Decimal box and read the hexadecimal box; the Hex working shows the division. By hand, divide by 16 again and again and write down the remainders, turning 10 to 15 into A to F. Read the remainders from the bottom up:

  • 687 ÷ 16 = 42 remainder 15 (F)
  • 42 ÷ 16 = 2 remainder 10 (A)
  • 2 ÷ 16 = 0 remainder 2

From the bottom up, the remainders give 2AF, so 687 in hex is 2AF. A quicker way for small numbers: convert to binary first, then swap every group of four bits for one hex digit.

The 16 hex digits

Hexadecimal uses the digits 0 to 9 and the letters A to F. Each one stands for exactly four bits:

Hex digitDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

Hex is everywhere in computing because it is short and lines up with bytes: two hex digits make one byte (00 to FF, or 0 to 255). Web colors use it too: #FF8000 is red 255, green 128, blue 0. For text written in hex, use Hex to Text.

How to count in binary

The numbers 0 to 16 in binary, octal, and hexadecimal:

DecimalBinaryOctalHex
00000000
10000111
20001022
30001133
40010044
50010155
60011066
70011177
801000108
901001119
100101012A
110101113B
120110014C
130110115D
140111016E
150111117F
16100002010

Larger numbers that come up often — 255 is the biggest value that fits in one byte:

DecimalBinaryOctalHex
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100
1000111110100017503E8
1024100000000002000400

Negative numbers: two’s complement

Computers store negative numbers using two’s complement. To find −5 in 8 bits: write 5 in binary (00000101), flip every bit (11111010), then add 1 (11111011). The first bit tells you the sign: 1 means negative. An 8-bit signed number holds −128 to 127; 16 bits hold −32,768 to 32,767. Type a negative decimal number and choose a bit width to see it.

Bits and bytes

A bit is one binary digit; a byte is 8 bits and holds 0–255. The converter shows how many bits and bytes your number needs — 255 fits in one byte, 256 needs two.

The binary clock

The live binary clock under the converter shows the current hours, minutes, and seconds in binary — a fun way to practice reading binary numbers every day.

More binary tools

Translate words and sentences with the Binary Translator, do sums with the Binary Calculator, and test yourself with the Binary Game. Everything runs in your browser — nothing is uploaded.

For teachers, bloggers & clubs

Put the Binary Converter on your website

Give your readers this tool right on your page. Copy the code, paste it into your site, done: no sign-up, no account.

  • Free for any website
  • No ads, no cookies
  • Fits phones and sidebars
  • Always up to date
See it live ↗

Please keep the small credit line under the tool; you may add rel="nofollow" to its link. How it works & the rules

› Show the code

Frequently asked questions

How do I convert binary to decimal?
Type the binary number in the Binary box and the decimal value appears instantly. By hand: add the place values (1, 2, 4, 8, 16 …) wherever there's a 1 — 101101 = 32 + 8 + 4 + 1 = 45. The converter shows this sum for you.
How do I convert decimal to binary?
Type the number in the Decimal box. By hand, divide by 2 repeatedly and read the remainders from bottom to top — the converter shows the full division table.
How do I convert binary to hex?
Split the bits into groups of four from the right and replace each group with a hex digit: 1010 1111 = AF. The converter does it instantly in both directions.
What is two's complement?
It's how computers store negative numbers. Flip all the bits of the positive number and add 1: −5 in 8 bits is 11111011. Choose 8, 16, 32 or 64 bits to see any value.
How do I convert hex to decimal?
Type the hex number in the Hexadecimal box and read the Decimal box. By hand, multiply each hex digit by its power of 16 (1, 16, 256, 4,096 … from the right), with A = 10 up to F = 15, and add: 2AF = 2 × 256 + 10 × 16 + 15 × 1 = 687. Tap Hex under Show the working for to see the sum for any number.
How do I convert decimal to hex?
Type the number in the Decimal box and read the Hexadecimal box. By hand, divide by 16 again and again, write down the remainders (10 to 15 become A to F) and read them from the bottom up: 255 ÷ 16 = 15 remainder 15, 15 ÷ 16 = 0 remainder 15, so 255 is FF. The Hex working shows the full division table.
What is FF in decimal?
FF is 255: F is 15, so FF = 15 × 16 + 15 = 255, the largest value one byte can hold. 100 in hex is 256, and FFFF is 65,535.
How large a number can it convert?
Any size — the converter uses exact arithmetic, so 64-bit values and much larger numbers are converted without rounding.
Is anything uploaded?
No. Everything runs in your browser — nothing you type is uploaded or stored.

About this page

The Binary Converter is a free tool from Linguaholic, made by Marcel Iseli. It runs in your browser, with no sign-up. Last updated .

Keep exploring

Browse all 118 tools