Turn text into binary, hex, decimal or octal bytes, and decode them back, in UTF-8
Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.Text becomes binary by turning each character into bytes and writing each byte as 8 bits. In UTF-8, English letters take 1 byte each, so "Hi" is 01001000 01101001 (72 and 105 in decimal); accented letters take 2 bytes and emoji 4. The same bytes can be written in hex, decimal or octal.
Type or paste your text into the Input pane, or click Try an example.
Choose Binary, Hex, Decimal or Octal; the bytes appear in the Output pane as you type.
Pick a separator, and turn on prefixes such as 0b or 0x if your code needs them.
Click Copy, or press Ctrl+Enter, to take the result.
Computers store text as numbers. A character set gives every character a number, and an encoding decides how that number becomes bytes. Almost every web page, file and API today uses UTF-8, so that is what this tool uses in both directions.
Encoding text. Each character becomes one to four bytes. The 128 ASCII characters, which cover English letters, digits and punctuation, are one byte each, with the same values ASCII has always had: A is 65, or 01000001 in binary and 41 in hex. Letters such as é take two bytes, most Indian and Asian scripts three, and emoji four. The output shows every byte in the base you pick:
| Base | One byte | "Hi" |
|---|---|---|
| Binary | 8 digits | 01001000 01101001 |
| Hex | 2 digits | 48 69 |
| Decimal | 0 to 255 | 72 105 |
| Octal | 3 digits | 110 151 |
Separators, an optional 0b, 0o or 0x prefix and upper or lower-case hex are yours to choose. A table under the result lists each character with its Unicode code point and its bytes, which is the quickest way to see why a string is longer in bytes than in letters.
Decoding bytes. Paste the numbers back and the text appears. Groups can be separated by spaces, commas or new lines; a long unbroken run of binary or hex is cut into bytes for you, and prefixes such as 0x and \x are ignored. The base is detected from what you paste, and you can override it. A group with a wrong digit, or a value above 255, is named by its position. Bytes that do not form valid UTF-8 are counted and shown as �, the way a browser shows them, instead of disappearing.
Everything runs in your browser; nothing you type is sent anywhere.
"hello" in binary is 01101000 01100101 01101100 01101100 01101111, one group of 8 bits per letter. Those are the ASCII codes 104, 101, 108, 108 and 111. Capital letters differ in one bit: "Hello" starts with 01001000, which is 72, because upper-case letters sit 32 places before lower-case ones.
An English letter, digit or punctuation mark takes 8 bits, one byte, in both ASCII and UTF-8. Characters outside ASCII need more in UTF-8: 16 bits for letters like é or ñ, 24 bits for most Hindi, Chinese and Japanese characters, and 32 bits for emoji. So byte count and character count often differ.
ASCII defines 128 characters, numbered 0 to 127, and uses one byte each. UTF-8 covers all of Unicode, more than 150,000 characters, and was designed so the 128 ASCII characters keep exactly the same single bytes. Any ASCII file is therefore already valid UTF-8; only characters beyond English need the extra bytes.
The replacement character � appears when the bytes are not valid UTF-8: a byte is missing or extra, a group was mistyped, or the data was written in another encoding such as Windows-1252. Check that every binary group has exactly 8 digits. The page counts the replaced bytes so you know how many are affected.
Split the binary into groups of 8 bits. For each group, add the place values of the 1s, which are 128, 64, 32, 16, 8, 4, 2 and 1 from left to right: 01001000 is 64 + 8 = 72. Then look the number up in an ASCII table, where 72 is H.
Yes. Hex pasted as 0x48 0x69, as \x48\x69 from a string literal, as 48,69 from an array or as one run such as 4869 decodes the same way. When encoding, switch on Prefix to write 0x before every byte, ready to paste into C, Java or JavaScript.
Rates and rules change; check the source before you rely on a figure.
Still stuck? Ask about Text to Binary Converter and anybody who knows can answer. No account needed.
Same job, other tools: Base64 Decode – Turn Base64 back into text or a downloadable file · Base64 Encode – Turn text or a file into Base64 · Query String Parser – Split a URL query string into a table of decoded parameters · HEX to RGB – Turn a hex colour code into rgb() values you can paste into CSS · Decimal to Binary – Convert decimal numbers into binary, grouped in fours.
On the related tools: TSV to JSON – Convert tab-separated values, such as a paste from Excel, into JSON.
Open it set for: Text to Hex Converter · Hex to Text Converter.