Explore all tools
FREE ONLINE TOOLNo visitor account required

Binary Converter

One number, four bases at once: type in binary, decimal, hex or octal and the other three follow. Below, a text-to-binary translator for messages.

Bits needed—
Bytes (rounded up)—

Text ⇄ Binary

Report a problem with this tool

Four Ways to Write the Same Number

Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) are just different spellings of the same quantity — 255 in decimal is 11111111 in binary, FF in hex and 377 in octal. Computers store binary; humans read decimal; programmers live in hex because one hex digit is exactly four binary digits, so a byte is always two hex digits. That is why memory addresses, colour codes (#FF5733 is red 255, green 87, blue 51) and error codes come in hex: it is binary, compressed into something a person can hold in their head.

Converting by Hand, Once, So It Sticks

Decimal to binary: repeatedly divide by 2 and read the remainders upwards. 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 r 0; 3 ÷ 2 = 1 r 1; 1 ÷ 2 = 0 r 1 — reading up gives 1101. Binary to decimal: add the place values — 1101 is 8 + 4 + 0 + 1 = 13. Hex groups binary in fours: 1101 is D (13) — which is why the converter above is handy for anything longer than a byte, where hand conversion becomes pure error-hunting.

Text as Binary

The text translator below the converter shows each character as its UTF-8 byte(s) in binary: "H" is 01001000, and characters beyond plain ASCII take two or more bytes. It is a good way to see encoding rather than just hear about it — and to understand why a character can be one byte in one encoding and three in another. Decoding accepts the same space-separated byte format; invalid groups are reported rather than silently mangled.

Frequently Asked Questions

How do I convert binary to decimal by hand?

Add the place values of the 1 bits. 1101 has 1s in the 8, 4 and 1 places, so it is 13. Each position is worth double the one to its right, starting from 1.

Why do programmers use hexadecimal so much?

Because one hex digit is exactly four binary digits, so a byte is always two hex digits. FF is 255, 00 is 0 — hex is binary in a form humans can actually read and type.

What is the largest number this converter handles exactly?

2^53 − 1 (9007199254740991), the largest integer JavaScript represents exactly. Beyond that, the converter warns you instead of quietly returning a rounded value.

How does text become binary?

Each character is stored as one or more bytes (UTF-8). "H" is the byte 01001000; characters outside plain ASCII use two to four bytes. The translator under the converter shows your text in that form, and converts back.