Binary, Hex and Text Converter

Convert text to binary, hex, octal or decimal bytes and back, with UTF-8 support

Group size (1 byte = 8 bits) applies to binary and hex output. Changing From rewrites your input in the new format. Text is read as UTF-8, so ₹ and Hindi letters take 3 bytes each.
Convert a single number
This treats your input as one number, not as text. For any base from 2 to 36, negative numbers and two's complement, use the Number Base Converter.

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

  1. 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.
  2. Type or paste into the box. The result appears on the right as you type, along with the number of bytes.
  3. Pick a Separator (space, none or comma) and, for binary or hex, a Group size of 1, 2 or 4 bytes.
  4. 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.
  5. 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:

CharacterCode pointUTF-8 bytes (hex)Bytes
AU+0041411
spaceU+0020201
éU+00E9C3 A92
क (Devanagari ka)U+0915E0 A4 953
₹ (rupee sign)U+20B9E2 82 B93
😀U+1F600F0 9F 98 804

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

H = 72 = 64 + 8 → 1001000 → 01001000
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.

Frequently Asked Questions

Choose Text in From and Binary in To, then type. Each character becomes its UTF-8 bytes, written as 8-digit binary numbers. "Hi" becomes 01001000 01101001.

Choose Binary in From and Text in To, and paste the bits. Spaces between bytes are optional as long as every byte has 8 digits.

Because its Unicode number, U+20B9, is above U+07FF. UTF-8 stores every character from U+0800 to U+FFFF in 3 bytes, so ₹ is E2 82 B9 in hex. Hindi letters take 3 bytes for the same reason.

41. The letter A is 65 in decimal, 41 in hex, 101 in octal and 01000001 in binary. Lowercase a is 97, or 61 in hex.

The bytes are probably not valid UTF-8. A multi-byte character may be cut off, or a bit may be missing. The tool shows a warning and puts � where it couldn't read the bytes.

No. Text conversion turns each character into bytes, so "10" becomes two bytes. To convert the number 10 to binary (1010), use the single number box or the Number Base Converter.