Skip to content

Binary Converter

Type a number in binary, octal, decimal or hex and see it in every other base at once, with the working shown. You also get its two’s complement form, and you can turn text into binary or hex and back. Big numbers stay exact.

How it converts

Two’s complement (signed)

Text to binary and back

Output

Key facts

Price
Free, with no sign-up and no usage limits
Privacy
Runs in your browser: your files and text are never uploaded
Works on
Any current browser on Windows, macOS, Linux, ChromeOS, Android and iPhone
Made by
Toolgu
Last updated

How to use the binary converter

  1. Type a number and choose its base: binary, octal, decimal, hex, or any base from 2 to 36. Prefixes like 0b, 0o and 0x and spaces between digit groups are fine.
  2. Every other base appears at once, grouped for easy reading, with a Copy button on each.
  3. See the working (place values, repeated division, or hex digits as groups of 4 bits) and the 8, 16, 32 and 64-bit two’s complement forms.
  4. Below, turn text into binary or hex bytes and back. Switching direction carries the output across.

Binary, octal, decimal and hex from 0 to 15

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

Why computers use binary and hex

A computer stores everything as bits, each either 0 or 1. Eight bits make a byte, which holds 256 values (0–255). Hex is a short way to write bytes: each hex digit is exactly four bits, so one byte is always two hex digits, like FF for 255 or 0A for 10. That’s why hex appears in color codes (#FF8800), memory addresses, MAC addresses and file dumps. Octal groups bits in threes and survives mainly in Unix file permissions, such as chmod 755.

Fractions and negative numbers

Fractions convert too: binary 0.1 is one half, and 0.01 is one quarter. Some decimal fractions, like 0.1, repeat forever in binary, so the result stops after 20 digits with “…”. That is why 0.1 + 0.2 isn’t exactly 0.3 in most programming languages. Negative whole numbers are stored in two’s complement: in 8 bits, −5 is 11111011 (invert 00000101 and add 1).

For other encodings, see Base64 and URL encoding; to hash text, use the hash generator. Picking colors in hex? Try the color picker.

Frequently asked questions

How do I convert binary to decimal?

Multiply each bit by its place value (1, 2, 4, 8… from the right) and add them. 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11.

How do I convert decimal to binary?

Divide by 2 again and again, writing down each remainder, then read the remainders from the bottom up. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 is 1101.

How do I convert binary to hex?

Split the bits into groups of four from the right and replace each group with one hex digit (0–9, A–F). 1011 0110 is B6.

How is text turned into binary?

Each character is encoded as bytes using UTF-8, and each byte is written as 8 bits. “A” is 65, or 01000001; letters with accents and emoji take two to four bytes.

What is two’s complement?

The way computers store negative whole numbers. To negate a number, invert every bit and add 1. In 8 bits, −1 is 11111111 and −128 is 10000000.