Skip to content
QuickKit 100% free · no login

Home › Developer Tools › Binary, Decimal & Hex Converter

Binary, Decimal & Hex Converter

Runs in your browserFree · no sign-up

Type a number in any base to see it in binary, octal, decimal, hexadecimal and base 36. Below it, convert text to binary or hex bytes and back.

Number converter

Text ↔ bytes

Advertisement

Number bases in one minute

We normally write numbers in base 10, where each position is worth ten times the one on its right. Computers work in base 2 (binary), where each position is worth twice the previous one and only the digits 0 and 1 exist. Hexadecimal (base 16) is a compact way to write binary, since one hex digit stands for exactly four bits; it uses 0 to 9 and A to F. Octal (base 8) groups bits in threes and appears in Unix file permissions. For example, decimal 255 is 11111111 in binary, FF in hex and 377 in octal.

How the converter works

The number you type is read digit by digit in the base you selected and accumulated using BigInt arithmetic, so there is no 53-bit limit and very large values stay exact. It is then written out in the other bases. Prefixes such as 0x, 0b and 0o and separators such as spaces and underscores are accepted. A leading minus sign is kept. If you enter a digit that does not exist in the chosen base, for instance a 2 in a binary number, the tool says the number is invalid instead of returning nonsense.

Converting by hand

  • Binary to decimal: add the place values where there is a 1. 1011 is 8 + 2 + 1 = 11.
  • Decimal to binary: divide by 2 repeatedly and read the remainders from bottom to top.
  • Hex to binary: replace each hex digit by its four-bit pattern. 3F becomes 0011 1111.

Text to binary and hex

Text is stored as numbers. The tool converts your text to UTF-8 bytes and writes each byte as 8-bit binary, two-digit hex or decimal. The letter H is byte 72, which is 01001000 in binary and 48 in hex. Plain English letters take one byte each, accented letters take two bytes, and most emoji take four, so "é" becomes 11000011 10101001. To decode, paste bytes separated by spaces and choose the matching format. Invalid bytes or sequences that are not valid UTF-8 produce an error.

Privacy

All conversions run in your browser, and nothing you type is sent anywhere.

Frequently asked questions

How do I convert binary to decimal?

Choose "Binary (2)", enter the number and read the decimal line. By hand, add the place values (1, 2, 4, 8…) where the digit is 1.

How do I convert hex to binary?

Select Hexadecimal, enter the value and read the binary line. Each hex digit equals four binary digits.

Can it handle very large numbers?

Yes. It uses BigInt, so values with hundreds of digits convert exactly.

What is the binary for the letter A?

A is ASCII 65, which is 01000001 in binary and 41 in hex.

Why does an emoji produce several bytes?

UTF-8 uses one to four bytes per character. Most emoji need four.

More free tools