Text to binary and hex, both ways

Type text to see its bytes in binary or hex, or paste binary or hex to read it as text, in your browser: nothing you type is uploaded.

  • Nothing uploaded
  • As you type
  • Any language
  • Free, no sign-up

Getting ready…

Quick facts from our tests

Check it yourself: once the page has loaded, turn off Wi-Fi and mobile data, and Text to Binary still works. Your browser's network panel (F12 on a computer) lists every request the page makes: you'll see Google's ad requests, and none of them carries your text. Our code never gives your text to the ad code. How we prove it

How to convert text to binary

  1. Type or paste

    Text, binary or hex.

  2. Pick the way

    To or from binary or hex.

  3. Copy the result

    Or download it.

When this tool isn't the right fit

  • You need a number in binary, such as 5 as 101. This tool converts characters; Hex to Decimal converts numbers between bases.
  • Your bytes are in another encoding, such as UTF-16. Only UTF-8 is read and written here.
  • Your binary has digits missing or extra. Binary must come in groups of 8 digits; count them and fix the group the page points to.

Why use PDFGuild's text to binary converter

More free tools

Private like this one: nothing you type or add leaves your device.

Text to Binary: the complete guide

How letters become bytes in UTF-8, binary and hex both ways, Hindi and emoji, the character 5 and the number 5, real results and tips.

In this guide
  1. What it does
  2. Step by step
  3. How it converts
  4. Real results
  5. Bytes and UTF-8
  6. Characters, not numbers
  7. Reading a byte by hand
  8. Everyday uses
  9. Opening a file
  10. Privacy
  11. Long texts
  12. Tips
  13. Limits
  14. Terms explained

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:

  1. Choose the way under Do: Text to binary, Binary to text, Text to hex or Hex to text.
  2. Type or paste in the top box, or choose Open a text file, or drop a file anywhere on the page.
  3. Read the result, and the line under it: "6 bytes in UTF-8: letters outside English take two to four."
  4. 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.

WayThe ruleExample
Text to binaryThe text's UTF-8 bytes, each as 8 binary digits, separated by spacesA is 01000001
Text to hexThe same bytes, each as 2 hex digits in small letters, separated by spacesHi is 48 69
Binary to textEvery 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 bytes0100100001101001 is Hi
Hex to text0x in front and anything that isn't a hex digit are skipped; the digits must come in pairs0x48 0x69 and 48:69 are Hi
Not a whole byteThe 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-8Bytes 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 sample

Bytes 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:

CharacterBytesBinary
A, an English letter101000001
₹, the rupee sign311100010 10000010 10111001
न, a Hindi letter311100000 10100100 10101000
😀, an emoji411110000 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.

Text to Binary after its sample: Hi and the rupee sign written as 6 bytes of binary in UTF-8
Our sample text in binary, written in the browser.

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.

Text to Binary after its sample: Hi and the rupee sign written as 6 bytes of binary in UTF-8, at a phone's size with the internet switched off by our test, between our test's bands that read "Internet switched off" and "Nothing uploaded: 0 requests sent data"
Proof from our testOn 9 November 2026, our test opened Text to Binary at a phone's size, switched the internet off and ran it on its built-in sample. It finished with no connection, and none of the page's 15 requests sent any data.How we test, and how to check it yourself

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.

Frequently asked questions

How do I convert text to binary?

Type or paste it with Text to binary chosen. Each byte of the text appears as 8 binary digits, with spaces between bytes. Copy it, or download it.

How do I convert binary to text?

Choose Binary to text and paste the 0s and 1s. Spaces and line breaks are skipped; the digits must come to whole 8-digit bytes.

What is A in binary?

01000001. A is the byte 65, and so is a capital A in every text saved as UTF-8 or ASCII.

Why does Hindi take more bytes?

Because UTF-8 stores each Hindi character in three bytes, and an English letter in one. नमस्ते is 18 bytes.

Why is 5 shown as 00110101?

Because this tool converts the character 5, which is stored as the byte 00110101. The number five in binary is 101; convert numbers with Hex to Decimal.

Can it convert hex too?

Yes. Text to hex shows each byte as two digits; Hex to text reads hex back, skipping 0x, spaces and colons.

Why does it say These bytes are not UTF-8 text?

Because the bytes don't follow UTF-8's rules, for example a byte that only continues a character with nothing before it. The tool doesn't guess what they meant.

Why does it say Binary text comes in groups of 8 digits?

Because the 0s and 1s don't come to a whole number of bytes: count the digits, one may be missing or extra.

Does it work for emoji?

Yes. An emoji is four bytes in UTF-8, so 😀 is 11110000 10011111 10011000 10000000.

Which encoding does it use?

UTF-8, the one almost every web page and app uses today.

Is Text to Binary free?

Yes. There is no sign-up and no watermark, and you can use it as often as you like. Ads from Google help pay for the site. They are kept apart from the tool, and our code never gives them your text.

Is my text uploaded anywhere?

No. The tool has no upload step: it works inside your browser and never sends the text you type, paste or open anywhere, and it keeps no copy of it. Google's ad code is on the page, and our code never gives it your text. How we prove it shows how to check.

How much text can it take at once?

Up to 500,000 characters, about 500 KB of English text. A paste or a file that would go over is not added, and the page says so. 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. See Long texts.

Can I open a text file, or a Word or PDF file?

A text file, yes: choose Open a text file or drop a .txt, .csv or similar file on the page, with up to 500,000 characters. A Word or PDF file must have its text copied out first, because the tool reads text, not those files.

Does it work offline?

Yes, once the page has loaded. 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. If you open the page for the first time with no internet, it can't load.

By the PDFGuild team · Updated · How we test