Categories

Text to Binary Converter

Convert text to binary, hex, decimal, and octal — and back

Enter some text above to see its binary, hexadecimal, decimal and octal byte codes.

Text to Binary Converter (and Hex, Decimal, Octal)

This free online converter turns any text into its binary, hexadecimal, decimal, and octal byte codes at the same time, and decodes those codes back into readable text. It is built for developers inspecting byte-level data, students learning how characters are stored, and anyone who needs to translate a binary or hex string back into words.

Text is encoded as UTF-8, the same encoding the web uses, so plain ASCII, accented letters, and emoji are all handled correctly and round-trip exactly. Everything runs locally in your browser with the TextEncoder and TextDecoder APIs — the text and codes you paste are never uploaded, stored, or sent to a server.

How to use Text to Binary Converter

  1. On the Text to codes tab, type or paste your text. The binary, hexadecimal, decimal, and octal representations appear instantly, along with an xxd-style hexdump.
  2. Choose a byte delimiter (space, comma, new line, none, or a custom string) and toggle zero-padding to control how the codes are grouped and spaced.
  3. Copy or download any single representation, or the whole hexdump, with the buttons beside each output.
  4. To go the other way, switch to the Codes to text tab, pick the input base (binary, hexadecimal, decimal, or octal), and paste your codes. The decoded text appears immediately.

Four representations at once

The encode mode shows all four common byte representations side by side so you do not have to convert one base at a time. Each character is expanded to its UTF-8 bytes, and every byte is shown in binary (base 2), hexadecimal (base 16), decimal (base 10), and octal (base 8).

Hi
Binary:  01001000 01101001
Hex:     48 69
Decimal: 72 105
Octal:   110 151
The word Hi shown in all four bases with a space delimiter; binary, hex, and octal are zero-padded.

Delimiter and padding options

  • Byte delimiter — separate each byte with a space, a comma, a new line, nothing at all (a single joined run), or a custom string such as a hyphen.
  • Zero-pad each byte — when on, every byte uses a fixed width: 8 digits for binary, 2 for hex, and 3 for decimal and octal. This keeps columns aligned and, with the None delimiter, makes hex and binary output unambiguous to decode.
  • The two options combine: 8-bit binary with a space delimiter gives the classic 01001000 01101001 layout, while hex with the None delimiter gives a continuous string like 4869.

Reading the hexdump

The hexdump view mirrors the output of the Unix xxd command. Each row starts with the byte offset in hexadecimal, followed by up to 16 bytes shown as hex in two-byte groups, and finally an ASCII gutter on the right where printable characters are shown literally and non-printable bytes appear as a dot. It is a fast way to see both the raw bytes and their text meaning at once.

00000000: 4865 6c6c 6f2c 2057 6f72 6c64 21    Hello, World!
A hexdump row: offset, hex bytes in pairs, then the ASCII interpretation.

Decoding codes back to text

The decode mode is deliberately forgiving about formatting. Select the base your codes are written in, then paste them separated by spaces, commas, new lines, or almost any punctuation. Common prefixes such as 0x and 0b are stripped automatically, joined hexadecimal is split into two-digit bytes, and joined binary is split into 8-bit bytes. If a character does not belong to the chosen base, or a value falls outside the 0 to 255 byte range, a clear message explains what to fix instead of producing garbage.

Hex input:  48 65 6c 6c 6f  ->  Hello
Binary in:  01001000 01101001  ->  Hi
Decoding is tolerant of spacing and optional prefixes.

Unicode and UTF-8

Because the tool encodes text as UTF-8, characters outside the basic ASCII range expand to more than one byte: most accented Latin letters take 2 bytes, most other scripts take 3, and emoji take 4. Those bytes are grouped per character in the output and are reassembled correctly on decode, so a full round-trip is lossless. If you decode raw bytes that are not valid UTF-8, the invalid parts are shown as the Unicode replacement character and a note is displayed.

A  -> 41 (1 byte)
é  -> C3 A9 (2 bytes)
😀 -> F0 9F 98 80 (4 bytes)
UTF-8 uses a variable number of bytes per character.

Related terminology

Bit and byte
A bit is a single 0 or 1; a byte is a group of 8 bits and can represent a value from 0 to 255. Text is stored as a sequence of bytes.
Binary (base 2)
A number system with only the digits 0 and 1. One byte is written as 8 binary digits, for example 01000001 for the letter A.
Hexadecimal (base 16)
A number system using the digits 0 to 9 and A to F. One byte is exactly two hex digits, which makes hex a compact way to show binary data.
Octal (base 8)
A number system using the digits 0 to 7. One byte fits in three octal digits, a notation still seen in file permissions and some escape sequences.
ASCII
A 7-bit character set numbering the basic English letters, digits, and symbols from 0 to 127. Its values are the same as the first 128 values of UTF-8.
UTF-8
The dominant text encoding on the web. It is backward compatible with ASCII but uses 1 to 4 bytes per character so it can represent every Unicode character, including emoji.
Hexdump
A side-by-side display of raw bytes in hexadecimal alongside their printable ASCII characters, as produced by tools like xxd and hexdump.

Frequently asked questions

How do I convert text to binary?
Open the Text to codes tab and type or paste your text. The binary representation appears instantly, along with hexadecimal, decimal, and octal. By default each byte is shown as 8 bits separated by spaces, and you can copy or download the result with one click.
Does it support emoji and non-English characters?
Yes. Text is encoded as UTF-8, so accented letters, non-Latin scripts, and emoji all convert correctly. They simply take more than one byte each — for example an emoji is 4 bytes — and those bytes are reassembled exactly when you decode.
How is this different from the Number Base Converter?
This tool converts whole strings of text into per-character byte codes and back, treating each character as one or more bytes. The Number Base Converter takes a single number and shows that one value in binary, octal, decimal, and hexadecimal. Use this tool for text and the Number Base Converter for individual numbers.
Why do my decimal or octal codes need spaces between them?
Binary and hexadecimal bytes have a fixed width (8 bits or 2 hex digits), so they can be split even when joined together. Decimal and octal values vary in length, so without a delimiter there is no way to know where one byte ends and the next begins. Keep a space, comma, or new line between decimal and octal codes when decoding.
What is the hexdump view for?
The hexdump shows the byte offset, the raw bytes in hexadecimal, and an ASCII gutter, just like the xxd command. It is handy for inspecting exactly which bytes a piece of text produces and for spotting invisible or non-printable characters.
Is my text uploaded to a server?
No. All encoding and decoding happens in your browser using the built-in TextEncoder and TextDecoder APIs. Nothing you paste is uploaded, logged, or leaves your device.

Related tools