Skip to content
gohacks.dev
Web

Text to Binary and Hex Converter

Convert text to its UTF-8 bytes in binary, hex, decimal or octal, or turn a list of bytes back into text.

Free · No sign-up · Your inputs stay in your browser

Input

Convert text to bytes and back

Output

Result

53 characters

Runs in this browser. Nothing you paste is sent to a server.

Bytes, not characters

A computer stores text as bytes in an encoding. In UTF-8, the encoding of almost the whole web, ASCII letters are one byte each and other characters two to four, so 'Hi ✓' is six bytes: 48 69 20 E2 9C 93. The same text in UTF-16 or Latin-1 would give different bytes, which is why a byte dump means little until the encoding is known.

The command-line version

printf 'Hi' | xxd prints hex and xxd -b binary; od -An -tx1 does the same on systems without xxd. In PHP, bin2hex() and hex2bin() convert in each direction.

Share

Frequently asked questions

What is 'hello' in binary?
01101000 01100101 01101100 01101100 01101111: the ASCII codes 104, 101, 108, 108 and 111, each as eight bits.
Why does my binary not decode?
The bytes are not valid UTF-8, often because they were produced from another encoding such as Latin-1 or UTF-16, or a byte was dropped.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools