How to convert text to binary, hex, or ASCII codes
- Type or paste your input. The tool detects whether it is text, binary, hex, octal, decimal codes, or Base64. You can also pick the format yourself.
- Choose what to convert to, the character unit (UTF-8 bytes, ASCII, UTF-16 code units, or Unicode code points), and how the values are separated.
- Copy the result, or press the swap button to turn it around and convert it back.
Without separators, binary is read in groups of 8 digits, hex in pairs, and octal in groups of 3 (twice that for UTF-16). Prefixes such as 0b, 0x, 0o, and \x are accepted and ignored on input.
Supported conversions
One tool covers all of these, in both directions:
- text to binary
- binary to text
- text to hex
- hex to text
- text to ASCII codes
- ASCII to text
- ASCII to binary
- binary to ASCII
- ASCII to hex
- hex to ASCII
- text to octal
- octal to text
- text to decimal
- decimal to text
- text to Base64
- Base64 to text
- binary to hex
- hex to binary
- binary to decimal
- decimal to binary
- hex to decimal
- decimal to hex
- octal to binary
- binary to octal
- hex to octal
- octal to hex
- Base64 to hex
- Base64 to binary
Questions
Is my text uploaded anywhere?
No. The conversion runs in your browser, so what you type or paste never leaves your device.
What is the difference between UTF-8 bytes and UTF-16 code units?
UTF-8 writes each character as one to four bytes, and plain English letters take exactly one byte, which is what most people mean by binary or hex text. UTF-16 uses 16-bit units, so every letter becomes 16 bits and an emoji becomes two units. Pick the one that matches the system you are working with. The character breakdown under the result shows both side by side.
How does auto-detect work?
It looks at the input: groups of 0s and 1s are read as binary, values with a 0x prefix or pairs of hex digits as hex, whole numbers separated by spaces as decimal, and a long Base64-looking string as Base64. Everything else is treated as text. If it guesses wrong, for example for a word made only of the letters A to F, choose the input format yourself.
Why does ASCII mode refuse some characters?
ASCII only has 128 characters: English letters, digits, punctuation, and control codes. Accented letters, other alphabets, and emoji are not part of it. Use UTF-8 bytes to convert them.
Can I convert binary straight to hex or decimal?
Yes. Set the input format to the one you have and Convert to the one you want. The text step is skipped, so any byte values work, even ones that are not readable text.
Credits
Built by OneTooling using standard browser features. No third-party code runs on your data.