How to use the ASCII to Hex tool
- Paste or type text into the ASCII text box. The Example button fills in ABC and runs the conversion.
- Select Convert to produce the hex bytes.
- Read the hex bytes in the Result box. Each character becomes two lowercase hex digits, with a space between bytes.
- Select Copy to grab the hex string, or Clear to start over.
How ASCII to hex conversion works
Each ASCII character is stored as one byte with a value from 0 to 127. Hexadecimal writes a byte with exactly two digits, because one hex digit covers four bits. The tool encodes your text to bytes, checks that every byte is in the ASCII range and prints each one in base 16, padded to two digits.
The output uses lowercase a to f, single spaces between bytes and no 0x prefix. ABC becomes 41 42 43. A line feed becomes 0a, with the leading zero kept so that every byte has the same width.
Reading the ASCII table by hex digit
Hex lines up with the structure of ASCII better than decimal does. The first digit tells you the kind of character and the second gives its position in that group.
- 00 to 1f: control codes. 09 is tab, 0a is line feed and 0d is carriage return.
- 20 to 2f: the space (20) and punctuation such as 2c for a comma and 2f for a slash.
- 30 to 39: the digit characters 0 through 9.
- 41 to 5a: uppercase letters, from 41 for A to 5a for Z.
- 61 to 7a: lowercase letters, from 61 for a to 7a for z.
Worked example: an HTTP request line
The text GET /index.html is 15 characters long, so it produces 15 bytes. The space is 20, the slash is 2f and the dot is 2e. This is the same byte sequence you would see for that text in a packet capture or a hex dump.
GET /index.html
47 45 54 20 2f 69 6e 64 65 78 2e 68 74 6d 6cWhere hex-encoded ASCII appears
Hex is the standard way to show raw bytes to people. Hex dump utilities, debuggers and protocol analyzers print it next to the text column. Percent-encoding in URLs uses it too: a space becomes %20 because the space character is byte 20 in hex. String escapes such as \x41 in many languages name a byte by the same two digits.
File signatures are often ASCII in disguise. The bytes 25 50 44 46 at the start of a PDF spell %PDF, and 50 4b at the start of a ZIP archive spell PK. Converting a short string here is a quick way to build a search pattern for a hex editor.
Limits and error messages
Only the 128 ASCII characters are accepted. Anything else, including accented letters, non-Latin scripts, non-breaking spaces and typographic quotes, triggers Enter ASCII characters only. The text is not trimmed, so spaces and line breaks at the edges are converted as well. Output is always space-separated, so remove the spaces yourself if you need one continuous string. The Hex to ASCII tool reverses the conversion.
Frequently asked questions
What is the hex value of the letter A in ASCII?
Uppercase A is 41 in hexadecimal, which is 65 in decimal. Lowercase a is 61. The gap of hex 20 between the cases holds for every letter.
Does the output include a 0x prefix?
No. The result is bare byte pairs such as 48 65 6c 6c 6f. If your code needs 0x48 style literals or a continuous string, add the prefix or strip the spaces after copying.
Are the hex digits uppercase or lowercase?
Lowercase. The letters a through f are printed in lowercase, for example 6c and 2f. Hex is case-insensitive, so 6C and 6c mean the same byte if another program expects capitals.
How many hex digits does one character take?
Two. An ASCII character is one byte, and a byte is two hex digits. A 10-character string therefore yields 20 hex digits plus the 9 spaces that separate the bytes.
Is anything uploaded when I convert?
No. The bytes are computed by script in the page itself. The text in the box is never posted to a server.