Convert text to binary or hex, and back

Turn text into binary, hexadecimal, octal or decimal byte codes, or read codes back into text. Uses real UTF-8 bytes and runs in your browser.

Exact byte codes for any text, read and written in your browser

Text is stored as bytes, and this shows them. Type a word and see the binary, hexadecimal, octal or decimal codes for each byte; paste codes and read them back as text.

The codes are the UTF-8 bytes of the text, which is the encoding nearly every web page, source file and API uses. For the letters, digits and punctuation of plain English, UTF-8 is identical to ASCII, so “A” is 01000001 in binary and 41 in hex, exactly as an ASCII table says. A letter with an accent, a character from another alphabet or an emoji takes two, three or four bytes, and each of them is written out. Tools that convert characters rather than bytes give a single, larger number for “é”, which matches nothing you will find in a file.

Reading codes back

Paste codes separated by spaces, commas or line breaks, and choose what they are. A long unbroken run of binary is split into groups of eight and a run of hex into pairs, which is how a hex editor or a log often prints them. The prefixes 0x, 0b and \x are ignored, so a value copied from source code can be pasted as it is.

If a code is not a byte (a binary group longer than eight digits, or a decimal above 255) the tool names it and its position. If the bytes are valid numbers but do not spell UTF-8 text, it says that too, rather than printing replacement characters. Those bytes are usually part of a binary file, or text saved in an older encoding such as Windows-1252.

Where this is useful

Checking what a byte sequence in a log or a packet says. Seeing why a string has more bytes than characters, which is behind many field-length errors in databases. Writing a test fixture with exact bytes. Teaching how text becomes binary. For whole numbers rather than text, use the number base converter, and for hidden or lookalike characters, the Unicode inspector.

Everything runs in your browser. Nothing you paste is sent anywhere, which matters when the text is a token or a password you are trying to read.

How to convert text to binary

  1. 1

    Paste text or codes

  2. 2

    Choose the direction and the kind of code

  3. 3

    Copy or download the result

Everything you need

Real UTF-8 bytes

Every character is written as the bytes it occupies in a UTF-8 file, so the codes match a hex dump, a packet capture or a network log.

Four bases, both ways

Binary, hexadecimal, octal and decimal, from text to codes or from codes back to text, with spaced or unbroken input.

Clear errors

A code that is not a byte, or bytes that do not form text, are named by their position instead of turning into a question mark.

Nothing is uploaded, and you can verify it

Processing runs on this device. Open the browser’s Network panel while the tool works and you will see no file upload request to FileGizmo. Temporary previews use local browser URLs, and closing or resetting the page releases them instead of leaving a server copy behind.

No daily limits, no watermarks

Use the tool without a daily task counter, account wall or watermark. Nothing is uploaded, so your device’s memory sets the practical size. Free limits a few repeat-work features, such as 20 images per background batch.

Works on any device, and offline after first load

Use a current browser on desktop, Android, iPhone, or iPad without installing an app. Once this tool and its required assets load, the cached workflow works without a connection. Large jobs are usually more comfortable on a desktop with additional memory.

Frequently asked questions

Why does é give two bytes?

Because it takes two bytes in UTF-8, C3 and A9. Letters outside plain English, and every emoji, are more than one byte, and the codes here are the bytes a file or a network message actually carries.

Can I paste binary without spaces?

Yes. An unbroken run of binary is read eight digits at a time and hex two at a time. Spaces, commas and line breaks between codes also work, as do 0x and 0b prefixes.

What if the codes are not text?

You are told so. Bytes that are not valid UTF-8 are reported rather than shown as replacement characters, because they are probably part of an image or a file in another encoding.

Is this ASCII?

For plain English letters, digits and punctuation, UTF-8 and ASCII give the same codes, so the result matches an ASCII table. Beyond those, UTF-8 is what modern files and web pages use.

Related guides

Format SQL, minify CSS and read bytes without breaking anythingWhy formatters and minifiers break working code, how strings, comments and UTF-8 bytes trip them up, and how to tidy code without pasting it into a server.