What Text to Binary does, and when you need it
Text to Binary shows the bytes a computer stores for a text, as binary (eight 0s and 1s for each byte) or as hex (two digits from 0 to 9 and a to f for each byte), and turns binary or hex back into text. Choose Text to binary, Binary to text, Text to hex or Hex to text, type or paste, and the result appears in the second box as you type, ready to copy or download. A line under it says how many bytes the text takes.
It uses UTF-8, the way almost every web page and app stores text today, so Hindi, Tamil, ₹ and emoji work too. It runs in your browser: your text is never uploaded and never saved, so closing the page forgets it.
Some jobs it is made for:
- Computer science homework: the binary of a letter or a word.
- Puzzles and secret messages written in 0s and 1s, both ways.
- Seeing why Hindi takes more room than English in a text message or a database.
- Reading hex from a log, a file viewer or a network tool as text.
- Checking an encoding problem, such as a ₹ sign that shows as strange letters.
Step by step: converting
It takes a few seconds, and the same steps work on a phone and on a computer:
- Choose the way under Do: Text to binary, Binary to text, Text to hex or Hex to text.
- Type or paste in the top box, or choose Open a text file, or drop a file anywhere on the page.
- Read the result, and the line under it: "6 bytes in UTF-8: letters outside English take two to four."
- Copy or download it.
Press Try a sample: the box fills with Hi ₹, and the result is 01001000 01101001 00100000 11100010 10000010 10111001: one byte each for H, i and the space, and three bytes for ₹. Choose Text to hex for the same bytes as 48 69 20 e2 82 b9.
How it converts, exactly
The rules are written here in full, and the same rules are checked by our tests.
| Way | The rule | Example |
|---|---|---|
| Text to binary | The text's UTF-8 bytes, each as 8 binary digits, separated by spaces | A is 01000001 |
| Text to hex | The same bytes, each as 2 hex digits in small letters, separated by spaces | Hi is 48 69 |
| Binary to text | Every 0 and 1 is read and everything else is skipped, so spaces and line breaks don't matter; the digits must come to a whole number of 8-digit bytes | 0100100001101001 is Hi |
| Hex to text | 0x in front and anything that isn't a hex digit are skipped; the digits must come in pairs | 0x48 0x69 and 48:69 are Hi |
| Not a whole byte | The page says "Binary text comes in groups of 8 digits, 0 and 1." or "Hex comes in pairs of digits, 0 to 9 and a to f." | 0100100 has only 7 digits |
| Not UTF-8 | Bytes that are no UTF-8 text are not guessed at; the page says "These bytes are not UTF-8 text." | 11111111 alone |
Text to binary and back, and text to hex and back, give the text you started with: our tests check that on English, on Hindi with ₹ and on text with a tab.
Real results from our tests
We tested Text to Binary with headless Chromium 148, the open-source browser Chrome is built on, on a Windows laptop with an Intel Core i7-1185G7 and 32 GB of memory, on 1 November 2026. Other work was running on the laptop at the same time, so times vary from run to run: each time below is the middle one of 3 runs.
Converting is quick. It took 437 milliseconds or less to turn 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji into binary, the most the page takes at once.
After a text is put in the box, the page waits 0.15 second before it works, so a burst of typing is worked on once, and 0.4 second when the text has more than 400,000 characters. So the result of 500,000 characters of English showed between 0.57 and 0.63 second after it was put in the box in our test. A result of more than 100,000 characters shows only its first 100,000 in the box, and says so, because showing a very long text is slow for the browser; Copy and Download take all of it.
Checked by our tests. Every example on this page is one of our tests, run on the page's own code. They cover the bytes of English letters, ₹, Hindi letters and emoji, binary and hex with and without spaces, 0x and colons, broken bytes and bytes that are not UTF-8, and text to binary and to hex and back.
Size and offline. On a first visit the page downloads about 0.1 MB for the tool: the page, its styles, its scripts and the fonts, with Google's ad code not counted. In our test we switched the network off after the page had loaded and pressed Try a sample: the result showed 0.2 seconds later or less in each of 15 runs.
Phone-sized screen. We also ran the tests on a phone-sized screen in headless Chromium (390 × 844 pixels, with touch). That is not a real phone. Every button, box and tick box was 44 pixels high or more, and the page did not scroll sideways. These tests don't cover Safari or Firefox.
Try it yourself: press "Try a sample" at the top of this page. It puts Hi and the rupee sign in the box, and the result is six bytes of binary, the last three for ₹. The page says 6 bytes in UTF-8. Then choose Text to hex.
Try the sampleBytes and UTF-8: why some letters take more
A computer stores text as bytes, and UTF-8 is the rule that turns each character into one to four bytes:
| Character | Bytes | Binary |
|---|---|---|
A, an English letter | 1 | 01000001 |
₹, the rupee sign | 3 | 11100010 10000010 10111001 |
न, a Hindi letter | 3 | 11100000 10100100 10101000 |
😀, an emoji | 4 | 11110000 10011111 10011000 10000000 |
So नमस्ते, which a reader sees as three letters, is 18 bytes: six characters (न, म, स, the joining mark, त and the vowel sign) of three bytes each. That is why a limit in bytes fills up about three times faster with Hindi than with English, and why Character Counter shows the bytes of a text as well as its characters.
The first bits of each byte tell a reader how many bytes belong together: a byte starting with 0 is a character on its own, one starting with 110, 1110 or 11110 starts a character of two, three or four bytes, and one starting with 10 continues a character. That is why 11111111 on its own is not UTF-8, and the page says so.
The character 5 is not the number 5
Text to Binary converts characters, not numbers. Type 5 and the result is 00110101, the byte that stores the character 5, not 101, which is the number five written in binary. In the same way, 12 gives two bytes, one for 1 and one for 2.
Homework that asks for "5 in binary" usually means the number, 101. For numbers, use Hex to Decimal, which converts a number between decimal, binary, hex and other bases. Homework that asks for the binary of a letter, or of the word Hi, means the characters, and that is what this tool does: Hi is 01001000 01101001.
Reading a byte by hand
Each of a byte's 8 digits has a value, from the left: 128, 64, 32, 16, 8, 4, 2 and 1. Add the values of the digits that are 1, and you have the byte's number. 01000001 has 1s in the places worth 64 and 1, so it is 65, the code for capital A. 01101001 is 64 + 32 + 8 + 1 = 105, small i.
Hex is the same number written in base 16: the byte 65 is 41, 4 sixteens and 1, and 105 is 69. Two hex digits always make one byte, which is why hex is the usual way to show bytes in programs and logs. To turn such numbers into decimal and back, use Hex to Decimal.
Everyday uses
- Write a message in binary for a puzzle, and read it back here.
- Read a hex dump: paste the hex from a file viewer or a log, choose Hex to text, and the text appears; spaces, colons and 0x are skipped.
- Find an encoding problem: a ₹ shown as strange letters is often its three UTF-8 bytes read one by one; seeing the bytes here makes it clear.
- Count bytes for a limit set in bytes, from the note under the result.
- Other codes: Morse Code Translator for dots and dashes, Base64 for data in letters.
Opening a text file
Choose Open a text file, or drop a file anywhere on the page, and the tool reads it on your device. These files open: .txt, .md, .csv, .tsv, .log, .json, .xml, .srt, .vtt, .html and other plain-text files, with up to 500,000 characters. The file's name and size appear below the box with an x; press the x to remove the file's text. The file is read on your device and never uploaded. The result can be copied, or saved as a new text file; the file you opened is never changed.
- Letters. A file saved as UTF-8 (a byte order mark at the start is dropped) or as UTF-16 with a mark is read correctly, Hindi and Tamil included. A file that is not valid UTF-8 is read as Windows-1252, and the page says so: "This file isn't saved as UTF-8, so it was read as Windows-1252. If letters look wrong, save it as UTF-8 and add it again."
- Windows line breaks. A Windows file stores each line break as two characters. The tool reads the pair as one line break, so each line break becomes one byte, 00001010.
- Several files. Only the first one opens, and the page says so, for example "Opening a.txt only. Open the others one at a time."
- Not a text file. A Word, PDF or picture file renamed to .txt is not read, and the page says it doesn't look like a text file. A file named .docx, .pdf or .rtf gets this message: "Only text files (.txt and similar) can be opened here. For a Word or PDF file, copy its text and paste it into the box."
- Empty or too long. An empty file says it is empty. A file with more than 500,000 characters is not opened, and the page says how many characters it has.
For a Word or PDF file, open it in the program you normally use, select the text, copy it, and paste it into the box. A PDF whose pages are scans holds pictures, not text, so there is nothing to copy.
Private: your text stays on your device
Your text never leaves your device. The tool runs inside your browser and has no upload step: it never sends the text you type, paste or open anywhere, and it keeps no copy of it, so closing the page forgets it. The page's Content Security Policy lets it contact only this site and Google's ad service, which pays for the site; our code never gives your text to the ad code. You can check it yourself in your browser's network panel (F12 on a computer): converting adds no request that carries your text. The site's menu does remember the last few tools you opened, on your device.
A message in binary is still a message. This tool turns it into bytes and back without handing it over. Our privacy policy says what we collect, and How we prove it shows how you can check our claims yourself.
Once the page has loaded, it also works with the internet switched off. In our test we switched the network off after the page had loaded and pressed Try a sample, and the result showed 0.2 seconds later or less in each of 15 runs.
Long texts
The tool takes up to 500,000 characters at once, about 500 KB of English text. What happens when a text is longer:
- A paste that would go over the limit is not added. This holds for Ctrl+V, for press and hold, and for the Paste button. The page says, for example: "That text is very long (550,000 characters), so it was not added. The box can hold 500,000 characters. Split it into smaller parts for faster results."
- A file with too many characters is not opened. The page says, for example: "long.txt has 550,000 characters, more than the 500,000 counted at once. Split it into smaller parts for faster results."
- A text that gets in some other way stays, unchanged. If text is dragged into the box, for example, it stays there, the result stays empty and the note says: "This text is very long (550,000 characters). Split it into smaller parts for faster results."
Converting is quick. In our tests it took 437 milliseconds or less to turn 500,000 characters of English, Hindi or a mix of English, Hindi, Tamil and emoji into binary. The slow part is the browser showing a very long text in a box, so a result of more than 100,000 characters shows only its first 100,000, without cutting an emoji in half, and the note says so, for example "Showing the first 100,000 of 164,999 characters. Copy and Download take all of it." Copy and Download always take the whole result.
Tips
- Spaces don't matter when you paste binary or hex: they are skipped.
- Count the digits if the page says a byte is missing: binary must be 8 digits a byte, hex 2.
- For numbers, use Hex to Decimal: this tool converts characters.
- Convert back to check: text to binary and back gives your text.
- Use hex for long texts: it is a quarter the length of binary for the same bytes.
- Keep your own copy. The page forgets everything when you close it.
Limits
- UTF-8 only. Other encodings, such as UTF-16 or Windows-1252, are not offered.
- Characters, not numbers. Numbers are converted as their digits' characters; use Hex to Decimal for numbers.
- Whole bytes. Binary must be groups of 8 digits and hex pairs of digits.
- No guessing. Bytes that are not UTF-8 text are not shown as text.
- Long results. Binary is about nine characters for every byte, so the result of a long text is long; the box shows its first 100,000 characters.
- 500,000 characters at once in the box, about 500 KB of English text.
Terms explained
- Bit
- A single binary digit, 0 or 1.
- Byte
- 8 bits, written here as 8 binary digits or 2 hex digits.
- Binary
- Numbers written with only the digits 0 and 1.
- Hex
- Hexadecimal: numbers written with the digits 0 to 9 and a to f, two to a byte.
- UTF-8
- The usual way of storing text as bytes: one byte for English letters, two to four for others.