Binary, Hex and Text Converter
Convert text to binary, hex, octal or decimal bytes and back, with UTF-8 support
Runs entirely in your browser. Nothing you type or upload is sent to us or stored.
Results are for general guidance. Please check anything important before relying on it. Terms of use
How to Use
- Choose what you have in From (Text, Binary, Hex, Octal or Decimal) and what you want in To. If you change From after typing, your input is rewritten in the new format.
- Type or paste into the box. The result appears on the right as you type, along with the number of bytes.
- Pick a Separator (space, none or comma) and, for binary or hex, a Group size of 1, 2 or 4 bytes.
- Click Copy result, or Swap to turn the result back the other way. For short inputs, the same bytes are shown in every format further down, each with its own copy button.
- To convert one number rather than text, use Convert a single number at the bottom.
Text, bytes and bases
Computers store text as bytes. A byte is 8 bits, so it holds a value from 0 to 255. This binary, hex and text converter shows those bytes in the form you need: binary (base 2), hexadecimal (base 16), octal (base 8) or plain decimal numbers. It also works the other way, turning binary or hex back into readable text.
The letters of English need one byte each. Many other characters need more, and that's where most online converters go wrong. This one uses UTF-8, the encoding used by almost every web page, app and phone today.
How UTF-8 decides the number of bytes
Every character has a Unicode number (its code point). UTF-8 stores small numbers in fewer bytes:
| Character | Code point | UTF-8 bytes (hex) | Bytes |
|---|---|---|---|
| A | U+0041 | 41 | 1 |
| space | U+0020 | 20 | 1 |
| é | U+00E9 | C3 A9 | 2 |
| क (Devanagari ka) | U+0915 | E0 A4 95 | 3 |
| ₹ (rupee sign) | U+20B9 | E2 82 B9 | 3 |
| 😀 | U+1F600 | F0 9F 98 80 | 4 |
Code points up to U+007F take 1 byte, up to U+07FF take 2, up to U+FFFF take 3 (this covers Hindi, Tamil, Bengali and the other Indian scripts) and anything higher, like most emoji, takes 4. So a Hindi sentence uses roughly three times as many bytes as an English one of the same length, which matters when an SMS gateway or database column has a byte limit.
Worked example: "Hi" in binary
i = 105 = 64 + 32 + 8 + 1 → 1101001 → 01101001
"Hi" = 01001000 01101001 = hex 48 69 = octal 110 151
Each byte is padded with zeros to a full 8 binary digits (2 hex digits, 3 octal digits), so the bytes line up and can be read back without separators.
Text "255" is not the number 255
This catches a lot of students. The text "255" is three characters, so it's three bytes: 32 35 35 in hex, or 00110010 00110101 00110101 in binary. The number 255 fits in a single byte: FF in hex, 11111111 in binary. Use the main converter for text and the "Convert a single number" box for numbers. For any base from 2 to 36, negative numbers and two's complement, use the Number Base Converter.
What the converter accepts
- Binary: bytes separated by spaces, commas or new lines, with or without 0b. Groups of 7 bits work too. Without separators, every byte needs all 8 digits.
- Hex: 48 69, 4869, 0x48 0x69, \x48\x69 and URL style %48%69.
- Octal and decimal: one number per byte (0–377 in octal, 0–255 in decimal). Without separators, write each byte as 3 digits, like 072105.
If the bytes aren't valid UTF-8 (for example a three-byte character cut in half, or text saved in an older encoding), the converter warns you and shows � where the bad bytes were.
Group size joins bytes together for binary and hex output: with 2 bytes per group, "Hi!" in hex becomes 4869 21. It's handy when matching the layout of a hex dump or a 16-bit register.