Text ↔ binary / hex. Encoded in your browser.
Your text never leaves your browser. Nothing is uploaded.
Binary, hex & entities without a round-trip to a server
Type text on the left to encode, or paste codes on the right to decode, the two panes stay in sync. Encoding is UTF-8 byte-accurate, so an emoji becomes its real four-byte sequence, not a broken single value; switch Unit to Unicode code points when you want one number per character instead. Choose your radix (binary, hex, octal, decimal) or HTML entities, control the delimiter and prefixes, and group output into readable lines. On decode, auto-detect reads the format for you. Everything runs in your browser, no account, nothing uploaded, free forever.
How to use the Text to Binary / Hex converter
This converter turns text into binary, hex, octal or decimal codes, or HTML entities, and turns those codes back into text. By default it works on the real UTF-8 bytes, so accented letters and emoji become their full multi byte sequences, and it can switch to one Unicode code point per character instead. It is for developers, students and anyone checking how text is stored.
Step by step
-
Pick a format
Press Binary, Hex, Octal, Decimal or HTML entities. Binary is selected first. The options below change to suit the format, for example Prefixes is hidden for Decimal.
-
Encode text
Type or paste into the Text pane on the left. The Code pane on the right fills in a moment after you stop typing, or press Encode. The page starts with the sample Hello, Digital Heroes! followed by a waving hand emoji.
-
Decode codes
Paste codes into the Code pane and the Text pane fills in, or press Decode. With Auto-detect format on decode ticked, the tool guesses the format from what you paste; untick it to force the format you selected.
-
Set the options
Unit switches between UTF-8 bytes and Unicode code points. Delimiter puts a space, nothing, or your own custom… text between values. Line break every starts a new line after 4, 8 or 16 values. Pad leading zeros keeps every value the same width, Prefixes adds 0b, 0x or 0o, and Uppercase hex shows A to F in capitals.
-
Set HTML entity options
With HTML entities selected, Entity style chooses decimal or hex entities, and Encode chooses every character, or only non ASCII characters plus the ampersand and the two angle brackets.
-
Copy or save
Press Copy text or Copy code to copy one pane. Download .txt saves the Code pane, or the Text pane if Code is empty. Swap exchanges the two panes without converting anything, and Clear empties both.
Reading the result
- The badge at the top right reports each action. For the sample it reads Encoded · 27 bytes → binary, while the Text pane shows 24 chars · 27 bytes: the emoji is one character but four bytes.
- In binary the sample starts 01001000 01100101, the bytes for H and e. In hex the emoji is f0 9f 91 8b as bytes, or the single value 1f44b as a code point.
- With Pad leading zeros on, each byte is 8 binary digits, 2 hex digits or 3 octal digits. In code point mode the widths are 16, 4 and 6.
- When auto-detect picks a different format from the one selected, the badge adds (auto-detected). Errors appear in red, such as Decimal needs a delimiter between values.
Tips and common mistakes
- Auto-detect reads anything with the letters a to f as hex and long runs of 0 and 1 as binary, and treats most other numbers as decimal. Octal without the 0o prefix, and hex with no letters such as 48 65, come out as decimal, so untick Auto-detect and pick the format yourself.
- Binary, hex and octal can be decoded without spaces as long as the length is a whole number of bytes: a multiple of 8, 2 or 3 digits. Decimal values must be separated, or they are read as one large number.
- Decode with the same Unit you encoded with. Bytes decoded as code points, or the other way round, turn accented letters and emoji into the wrong characters.
- In bytes mode, any value over 255 cannot be a byte, so the tool decodes the whole input as code points instead and says so in the badge.
- Switching formats re-encodes whatever is in the Text pane. Clear the Text pane first if you want to decode the Code pane in a new format.
Privacy and limits
Every conversion runs in your own browser. Nothing you type is sent anywhere or saved, so reloading the page brings back the sample text.
Everything a code converter should do.
- Encode text to five formats, binary, hex, octal, decimal codes or HTML entities, from a single toggle.
- Decode any of them back to text, with auto-detect that reads the format from what you paste.
- Stay UTF-8 correct: work on real UTF-8 bytes, or switch to Unicode code points for one value per character.
- Control delimiters & prefixes, space, none or a custom separator, plus optional
0b/0x/0onotation and uppercase hex. - Group output into lines every 4, 8 or 16 units, and pad leading zeros for fixed-width tokens.
- Copy or download the result as a
.txtfile, or swap the two panes with one click, all in your browser.
Frequently asked questions.
Is the Text to Binary / Hex converter free?
Is it private? Is my text uploaded anywhere?
Does it handle emoji and other Unicode correctly?
What's the difference between UTF-8 bytes and code points?
Can it auto-detect binary vs hex when I decode?
Published · Last updated .