CheckConvert

All tools

Hex and binary converter

Decimal, hex, binary and octal, all four at once

Type in any box. The example turns 255 into hex, binary and octal.

Such as 255 or -42

Digits 0 to 9 and A to F, such as FF or 0x1A

Only 0 and 1, such as 1010

Digits 0 to 7, such as 377

Type in any box. The other three fill in. Whole numbers of any size up to 1,000 digits.

–

Bits needed
–
Bytes needed
–
Two's complement
–

How the converter works

Decimal, hex, binary and octal are four ways of writing the same whole number. Decimal uses ten digits (base 10). Hex, short for hexadecimal, uses sixteen: 0 to 9, then A to F for 10 to 15. Binary uses only 0 and 1 (base 2), and octal uses 0 to 7 (base 8). Type in any box and the other three fill in. The numbers are kept as exact whole numbers, so even a 1,000-digit number is converted without rounding.

Worked example

255 ÷ 16 = 15 remainder 15, and 15 ÷ 16 = 0 remainder 15. Each 15 is the hex digit F, so 255 is FF. Going back, FF = 15 × 16 + 15 = 255. In binary, F is 1111, so FF is 1111 1111, which is one byte. The working line under the answer shows these steps for your number.

What you can type

Spaces and underscores between digits are ignored. The prefixes 0x (hex), # (colour codes), 0b (binary) and 0o (octal) are accepted. Letters can be capitals or lower case. A digit that does not belong, such as G in hex or 2 in binary, gets a message naming it.

Negative numbers

A minus sign is kept in front: -255 is -FF in hex. Computers usually store negative numbers as two's complement in a fixed number of bits, where -1 is FF in 8 bits. The page shows that separately, so the main answers stay plain. Fractions and decimal points are not converted.

Decimal, hex, binary and octal chart

The numbers 0 to 16 and some common round values.

Decimal, hex, binary and octal
DecimalHexBinaryOctal
0000000
1100011
2200102
3300113
4401004
5501015
6601106
7701117
88100010
99100111
10A101012
11B101113
12C110014
13D110115
14E111016
15F111117
16101000020
322010 000040
6440100 0000100
10064110 0100144
1277F111 1111177
128801000 0000200
255FF1111 1111377
2561001 0000 0000400
1,0003E811 1110 10001750
1,024400100 0000 00002000
4,09610001 0000 0000 000010000
65,535FFFF1111 1111 1111 1111177777

Rules and sources

Found a mistake?

Email [email protected] with the page, what you typed and what you expected. Confirmed errors are fixed and added to the check.

Related tools