Binary and Hex Text Converter
Turn text into binary, hex, octal or decimal bytes — and back — using UTF-8, so anything from plain English to emoji survives the round trip.
—
What this tool does
Every piece of text a computer handles is ultimately a sequence of bytes — numbers from 0 to 255. This converter shows you that sequence, in whichever base you choose, and converts it back. Binary shows each byte as eight bits, hex as two hexadecimal digits, octal as three octal digits, and the decimal view as the plain byte values separated by spaces.
The reason to prefer this over an ASCII-only converter is UTF-8. English letters map to one byte, but an accented letter, a Greek or Cyrillic letter, a Chinese character or an emoji takes two to four bytes, and the tool handles that splitting and joining for you. Typical uses are checking what a protocol or file format actually contains, debugging a mojibake problem where text was decoded with the wrong charset, teaching how character encoding works, and decoding a byte dump pasted out of a log or a hex editor.
Method
Encoding runs the input through the browser's UTF-8 encoder, which yields a byte array, then
formats each byte according to the selected base — toString(2) padded to eight bits,
toString(16) padded to two digits, toString(8) padded to three, or the
raw decimal value. Decoding reverses this: binary input is split into eight-bit groups when the
digit count divides evenly by eight, hex is read in pairs, and octal and decimal are read as
separate numbers; the resulting bytes are handed to the UTF-8 decoder.
| Text | Binary | Hex | Decimal |
|---|---|---|---|
| A | 01000001 | 41 | 65 |
| a | 01100001 | 61 | 97 |
| space | 00100000 | 20 | 32 |
| é | 11000011 10101001 | C3 A9 | 195 169 |
Example
| Text | Hex (UTF-8) |
|---|---|
| Hi | 48 69 |
| Hello | 48 65 6C 6C 6F |
| café | 63 61 66 C3 A9 |
Binary, octal, decimal and hex are the same number
The base a number is written in does not change the value — 255, 0b11111111, 0377 and 0xFF are the same integer in four notations. Which one you use is a question of what reads best in the context: binary shows the individual bits, hex groups four bits per digit, and octal groups three.
| Base | Digits | One digit is | Readable for |
|---|---|---|---|
| 2 | 0–1 | 1 bit | Flags, bitmasks, protocol fields |
| 8 | 0–7 | 3 bits | Unix file modes, legacy systems |
| 10 | 0–9 | — | Values a person reads |
| 16 | 0–9 A–F | 4 bits | Bytes, colours, hashes, memory dumps |
Hex is the practical default for bytes because two hex digits are exactly one byte — which is why a memory address or a colour is written as pairs. Binary is clearer when you need to see individual flags; octal survives mainly because file permissions (0755) are conventionally written that way.
Text to binary is not converting a number
There are two different operations that both get called “text to binary”. One encodes each
character as its code point in binary — A is 65, so 1000001. The other
encodes the UTF-8 bytes of the string, which for ASCII is the same thing and for anything else is
not: a character such as é becomes two bytes, so two eight-bit groups. This tool
states which representation it produces, because decoding the wrong one gives a plausible but
wrong string.
Bits, bytes and word size
A byte is eight bits. A “word” is architecture-dependent — 32 or 64 bits on modern hardware — and that matters when reading a binary dump: the same bytes interpreted as big-endian or little-endian 32-bit words give different numbers. A converter that works on bytes sidesteps the question; one that claims to show “the value” has to state its byte order.
Frequently asked questions
What does this converter do?
It turns text into the numbers a computer stores for it, in binary, hexadecimal, octal or decimal bytes, and turns any of those back into text. The encoding used is UTF-8, the same one the web uses.
Why does one character become more than one byte?
Plain English letters are one byte each, but anything else — accented letters, Greek, Cyrillic, CJK, emoji — takes two to four bytes in UTF-8. That is why "é" is C3 A9 in hex rather than a single pair.
Is this the same as ASCII?
For the first 128 characters, yes: UTF-8 bytes for basic Latin match ASCII. Beyond that they differ, because ASCII has no representation for those characters at all.
How should I paste binary?
Either as eight-bit groups separated by spaces, or as one unbroken run whose length is a multiple of eight. Both are accepted. Hex and octal follow the same idea: hex is read in pairs, octal and decimal bytes are read as separate numbers.
Is Base64 the same thing?
No. Base64 re-encodes bytes using 64 printable characters to travel safely through text-only channels; it is longer-looking but not binary. This page shows the raw byte values instead.
Does anything leave my browser?
No. The conversion runs entirely in the page, so pasted text and byte dumps stay on your machine.
Go deeper
Longer explanations of the problems this tool solves:
Sources
- Unicode Standard and RFC 3629, UTF-8, a transformation format of ISO 10646.
- WHATWG Encoding Standard, for the byte-level behaviour of the browser's UTF-8 encoder and decoder.
Everything runs in your browser — nothing you type is uploaded.