# Text to Binary

Convert text to binary, hex, octal or decimal, using real UTF-8 bytes. Free, and nothing you paste is uploaded.

Canonical page: https://filetity.com/text-to-binary

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: Any text in. Binary, hexadecimal, octal or decimal out, as UTF-8 bytes or as code points, with a separator you choose.
- Limits: No length limit beyond what a text box holds. Binary is eight times the size of the text, so a long paragraph produces a very long line.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, once the page has loaded. The tool keeps working with no network connection.

## Questions

### Why is my emoji eight numbers instead of one?

Because it is four UTF-8 bytes, and in binary each byte is eight digits. That is what a file or a network connection actually contains. Switch to code points and the same emoji becomes a single number, which is what most teaching material means.

### Is this ASCII or UTF-8?

UTF-8, which is the same thing as ASCII for the first 128 characters, so plain English text gives identical results either way. They diverge at accented letters and everything beyond, where ASCII simply has no answer and UTF-8 uses two or more bytes.

### Why not just use charCodeAt?

Because it gives UTF-16 code units, so an emoji comes out as two meaningless halves and non-Latin scripts produce numbers that match no other tool. That is the single most common bug in a text to binary converter, and it only shows up once somebody pastes something that is not English.

### What is the padding for?

So the output lines up. Each UTF-8 byte becomes exactly eight binary digits or two hex digits whether or not it needs them, which makes the result readable in columns and, more importantly, makes it possible to read back without separators.

### Can I use a different separator?

Yes: a space, nothing at all, a dash or a comma. Nothing at all is the one to pick when the result is going somewhere that expects a continuous string, and it still reads back correctly because the padding makes the byte boundaries unambiguous.

## Related tools

- [Binary to Text](https://filetity.com/binary-to-text): Convert binary, hex, octal or decimal numbers back into text.
- [Base64 decode and encode](https://filetity.com/base64-decode): Decode base64 to text, or encode text to base64, without leaving the page.
