Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Text to Binary & Hex Converter

See the exact bytes behind any text, and turn binary or hex dumps back into text.

Developer No upload Works offline Free, no sign-up

Type or paste text to see its bytes.

Show bytes as

Character by character

Next steps

About the Text to Binary & Hex Converter

Type text to see its bytes in binary, hexadecimal, octal or decimal — in UTF-8, UTF-16 (little- or big-endian) or Latin-1 — with your choice of separator, prefix (0x, \x, %, 0b, \) and grouping. A character-by-character table shows exactly which bytes each letter, accent or emoji takes.

Switch to Bytes → text to decode the other way. It reads what people actually paste: 01001000 01101001, 48 69, 0x48, 0x69, \x48\x69, [72, 105], Python b'caf\xc3\xa9' and dumps from xxd, hexdump -C, od and Wireshark (offsets and the text column are skipped). Every invalid UTF-8 or UTF-16 sequence is listed with its byte offset and the reason, and a decoded dump can be saved as a real file. Everything runs in your browser.

How to use it

  1. Choose Text → bytes and type or paste your text.
  2. Pick how to show the bytes (binary, hex, octal or decimal), the encoding, and optionally a separator, prefix or grouping. The result updates as you type.
  3. Open Character by character to see the code point and bytes of every character.
  4. To decode, choose Bytes → text and paste the bytes. Leave Read bytes as on Auto-detect, or pick the format if the guess is wrong.
  5. Copy or download the result, use Save bytes as a file to rebuild a file from a hex dump, or press Use as input to convert the result back.

Examples

Text to binary
Input
Hi
Result
01001000 01101001

“H” is 72 (hex 48) and “i” is 105 (hex 69); each byte is written as 8 binary digits.

One letter, two encodings
Input
café
Result
UTF-8:   63 61 66 c3 a9
Latin-1: 63 61 66 e9

UTF-8 needs two bytes for “é”; Latin-1 fits it in one but has only 256 characters.

An emoji in UTF-8 and UTF-16
Input
👋
Result
UTF-8:    f0 9f 91 8b
UTF-16BE: d83d dc4b

Characters above U+FFFF take four bytes in UTF-8 and a surrogate pair in UTF-16.

Decode an xxd dump
Input
00000000: 4865 6c6c 6f2c 2077 6f72 6c64 210a  Hello, world!.
Result
Hello, world!

The offset and the text column on the right are ignored automatically.

Spot broken UTF-8
Input
63 61 66 c3 28
Result
caf�(
Byte 3 (0xC3): 0xC3 starts a 2-byte sequence, but the next byte, 0x28, is not a continuation byte.

Common uses

  • Learning or teaching how characters are stored: ASCII, UTF-8 multi-byte sequences, UTF-16 surrogate pairs.
  • Debugging encoding bugs: seeing whether a string really contains a non-breaking space, a BOM or a stray zero-width character.
  • Reading hex dumps from xxd, hexdump, Wireshark or a debugger as text, or rebuilding the original file from them.
  • Producing byte arrays and escape sequences (0x48, 0x69, \x48\x69, %C3%A9) for code, tests and URLs.
  • Decoding binary or hex messages in puzzles and CTF challenges.

How text becomes bytes

Every character is a Unicode code point, written U+0041 for “A”. An encoding turns code points into bytes:

  • UTF-8 uses 1 byte for U+0000–U+007F (plain ASCII), 2 bytes up to U+07FF (accented Latin, Greek, Cyrillic, Arabic, Hebrew), 3 bytes up to U+FFFF (Indian scripts, Chinese, Japanese, most symbols) and 4 bytes above that (emoji). It is the standard on the web.
  • UTF-16 uses 2 bytes per character up to U+FFFF and a 4-byte surrogate pair above it. LE (little-endian, used by Windows) writes the low byte first, BE the high byte first.
  • Latin-1 (ISO-8859-1) uses exactly one byte per character, so it can only hold U+0000–U+00FF; anything else is reported instead of being silently replaced.

A byte-order mark (BOM) — EF BB BF in UTF-8, FF FE or FE FF in UTF-16 — can be added when encoding; when decoding, a leading BOM is removed and reported.

Reading pasted bytes

Separators can be spaces, commas, colons, dashes or new lines, and each value may carry a prefix: 0x, \x or % for hex, 0b for binary, 0o or \ for octal. A run of hex or binary digits without separators is split into bytes (two hex digits or eight bits each). Text inside [...] or {...} is read as an array, and quoted strings with escapes such as \x41, \101 or \n are read the way C, JavaScript and Python do.

Auto-detect tries binary, hex, decimal and octal and keeps the reading that gives the most plausible text. When two readings both make sense — 72 69 76 76 79 is “rivvy” in hex and “HELLO” in decimal — it says so and offers the other one with one click.

Invalid sequences

Not every byte sequence is valid UTF-8: a continuation byte (0x80–0xBF) cannot stand alone, a lead byte needs the right number of continuation bytes, and overlong forms, surrogates (U+D800–U+DFFF) and values above U+10FFFF are forbidden. Like browsers (WHATWG Encoding Standard), the decoder replaces each broken sequence with one U+FFFD (�) and keeps going — and it lists every one with its byte offset and the rule it breaks. If the bytes decode cleanly in another encoding, the page offers to switch.

Limitations

  • Latin-1 means ISO-8859-1, where bytes 0x80–0x9F are invisible control characters. Text from Windows is usually Windows-1252, which puts € ‘ ’ “ ” and other characters there — use the Text Encoding Converter for Windows-1252 and other legacy encodings.
  • hexdump without -C (and od -x) prints 16-bit words, which on most computers shows each pair of bytes swapped. Paste hexdump -C or xxd output instead; the page warns when it sees word-style dumps.
  • Rows that hexdump or xxd -a leave out as * cannot be filled back in; dump with hexdump -v or plain xxd to get every byte.
  • Up to 500,000 characters of text or 4 million characters of pasted bytes at a time.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

Frequently asked questions

How do I convert text to binary?

Each character is turned into bytes by an encoding (UTF-8 here by default), and each byte is written as eight binary digits. “A” is byte 65, which is 01000001 in binary; “Hi” is 01001000 01101001. Type your text above and the binary appears as you type.

Why does an accented letter or emoji give more than 8 bits?

Only the 128 ASCII characters fit in one UTF-8 byte. “é” takes two bytes (c3 a9), “€” three (e2 82 ac) and most emoji four. Open Character by character to see the bytes of each one.

What is the difference between UTF-8 and UTF-16?

Both can store every Unicode character. UTF-8 uses 1–4 bytes per character and is identical to ASCII for English text, so it is the standard for the web and files. UTF-16 uses 2 or 4 bytes and is what Windows, Java and JavaScript strings use internally.

Why is there a � in the decoded text?

The bytes at that point are not valid in the chosen encoding, so they are replaced with U+FFFD, as a browser would. The list under the result shows each invalid sequence, its byte offset and what is wrong. Often the data is simply in another encoding — the page suggests Latin-1 or UTF-16 when those decode cleanly.

Is Latin-1 the same as Windows-1252?

No. They agree except for bytes 0x80–0x9F, which are control characters in ISO-8859-1 but € ‘ ’ “ ” – — and others in Windows-1252. Browsers even treat the label “latin1” as Windows-1252; this tool uses true ISO-8859-1, so byte = code point.

Can I rebuild a file from a hex dump?

Yes. Choose Bytes → text, paste the dump (xxd, hexdump -C, od or plain hex) and press Save bytes as a file: the exact bytes are downloaded as a .bin file you can rename.

Is my text sent anywhere?

No. Encoding and decoding happen in your browser; nothing you type or paste is uploaded, and the page works offline once loaded.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.