ASCII to Hex
Convert ASCII text into hexadecimal bytes. Paste input, choose character encoding if needed, then copy the hex output for scripts and debugging.
ASCII to Hex
Result
What the ASCII to Hex tool does
This turns your text into hexadecimal, the compact base-16 way of writing the code behind each character. Type or paste your text, press Convert, and copy or download the result. The word "Hi" comes out as 48 69, because the H has the hex code 48 and the i has 69. It is the same character codes you would see as plain numbers, just written in the base that programmers reach for most.
It runs in your browser, so nothing you enter is uploaded.
How to use it
- Enter your text. Type or paste it, or drop in a text file.
- Choose options if you want. You can pick a character encoding and a separator for the output, though the defaults suit ordinary text.
- Press Convert. The hex appears, ready to Copy or Download.
Why hex, and what it shows
Hexadecimal is counting in base 16. Where we normally use ten digits, hex uses sixteen, the usual 0 to 9 plus the letters A to F standing for the values ten to fifteen. The reason it is everywhere in computing is that it lines up perfectly with bytes. One byte holds a value from 0 to 255, and that fits in exactly two hex digits, so any character's code becomes a tidy two-character pair. Hex is far shorter than binary, where the same byte takes eight digits, and much easier to read at a glance, which is why you see it in colour codes, memory addresses, and tools like this one. Each character here becomes its code written as two hex digits.
A worked example with real letters
Take the H in "Hi". Its character code is 72, the same value the Text to ASCII tool would give. To write 72 in hex, you split it into groups of sixteen: 72 is four sixteens, which is 64, with 8 left over, so it comes out as 48 in hex, a 4 then an 8. The i has the code 105, which is six sixteens, 96, with 9 left over, giving 69. So "Hi" becomes 48 69. If you ever see a capital A written as 41 in some data, that is the same thing: A is code 65, which is four sixteens plus 1.
Beyond plain English: the encoding choice
For everyday English the default handles everything, but the character encoding option lets the tool go further. The basic character set only covers 128 characters, so to handle accented letters, other alphabets, or symbols, a fuller scheme is needed to turn those characters into bytes. The tool offers a range of them, with UTF-8, the modern web standard, as the default, plus others for particular languages and older systems. With a suitable encoding chosen, a character outside the basic set simply becomes more than one byte, and you get the hex for each of them. So it is not limited to English text, as long as the encoding knows your characters.
Going the other way
If you already have hex codes and want the text back, that is the opposite job, handled by the Hex to ASCII tool. This one turns characters into hex; that one turns hex into characters.
Questions people ask
Why is each character two hex digits?
Because a character's code fits in one byte, and one byte is exactly two hex digits. That is what makes hex such a neat fit for showing byte values.
Why are there letters like A to F in the output?
Because hex needs sixteen digits, so after 0 to 9 it uses A to F for the values ten to fifteen. They are digits here, not text.
How do I turn hex back into text?
Use the Hex to ASCII tool, which reverses this one, reading the hex pairs back into characters.
References
- Cerf, V. (1969). RFC 20: ASCII format for Network Interchange. Internet Engineering Task Force (IETF). https://www.rfc-editor.org/rfc/rfc20
- The Unicode Consortium. The Unicode Standard. https://www.unicode.org/standard/standard.html
Bhabin Khadka is a software engineer and graduate student at the University of New England with experience in backend development and scalable systems. He has a particular interest in file systems and the kinds of technical utilities that depend on dependable handling of structured data. At Eon Tools, he reviews file and document tools, as well as encode and decode tools.