Hex ↔ ASCII Converter

Convert text to hexadecimal or hex back to ASCII. Supports space-separated and 0x prefix output. 100% client-side.

Input
Output
Paste text or hex values above to convert.

How to Use the Hex ↔ ASCII Converter

  1. Paste your input — ASCII text for hex output, or hex values for ASCII output.
  2. Choose direction — use the "ASCII → Hex" or "Hex → ASCII" chip to set the conversion direction.
  3. Choose output format — optionally add "Space-separated" for readability or "0x Prefix" for programming use.
  4. Copy or download — use the buttons above the output to copy or save the result.

What Is Hexadecimal?

Hexadecimal (often shortened to "hex") is a base-16 number system that uses the digits 0 through 9 and the letters A through F to represent values from 0 to 15. In computing, a single byte of data (8 bits) can be represented as exactly two hexadecimal digits, making hex a compact and human-readable way to work with binary data. For example, the decimal number 255 (which is 11111111 in binary) is represented as FF in hexadecimal. The decimal number 65, which corresponds to the ASCII character A, is represented as 41 in hex.

What Is ASCII?

ASCII (American Standard Code for Information Interchange) is a character encoding standard developed in the 1960s that maps the numbers 0 to 127 to specific characters. It includes uppercase letters (A–Z, codes 65–90), lowercase letters (a–z, codes 97–122), digits (0–9, codes 48–57), punctuation marks, and control characters (like newline, tab, and carriage return). ASCII is the foundation of virtually all modern character encoding systems, including UTF-8, which is backward compatible with ASCII for the first 128 characters.

Output Format Options

  • Default — compact hex string with no separators (e.g., 48656c6c6f)
  • Space-separated — each byte separated by a space for readability (e.g., 48 65 6c 6c 6f)
  • 0x Prefix — each byte prefixed with 0x, space-separated (e.g., 0x48 0x65 0x6c 0x6c 0x6f)

Where Is Hex Used?

Hexadecimal representation appears in many areas of software development and computer science:

  • Network analysis — tools like Wireshark display raw packet data as hex dumps
  • Debugging — debuggers and memory inspectors show memory contents in hex
  • Colors in CSS and design tools — colors are expressed as 6-digit hex codes (#10b981)
  • Cryptography — hash values, encryption keys, and digital signatures are displayed in hex
  • File formats — file headers and "magic numbers" that identify file types are specified in hex
  • Assembly language — memory addresses and instruction codes are written in hex
  • Binary protocols — binary data is encoded in hex for logging and debugging

Reading a Hex Dump

When working with tools like xxd or hexdump on Linux, the output typically shows three columns: the offset (position in the file), the hex values of the bytes, and the ASCII representation on the right (with non-printable characters shown as dots). Understanding this format is essential for reverse engineering, forensic analysis, and low-level protocol debugging. This converter helps you quickly decode individual hex values to understand what ASCII characters they represent. For related number system conversions, try our Number Base Converter or Binary to Text Converter.

Frequently Asked Questions

Hexadecimal (hex) is a base-16 numbering system that uses the digits 0-9 and the letters A-F. In computing, each byte of data (8 bits) can be represented as exactly two hexadecimal digits. For example, the letter A has an ASCII code of 65, which is 41 in hexadecimal.
ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numbers 0 to 127 to letters, digits, punctuation, and control characters. For example, the letter A is 65, lowercase a is 97, and the digit 0 is 48. ASCII is the foundation of most modern character encodings including UTF-8.
The 0x prefix is a convention used in programming languages (C, C++, Java, JavaScript, Python) to indicate that a number is written in hexadecimal. For example, 0x41 means the hexadecimal value 41, which equals 65 in decimal and represents the letter A in ASCII. The prefix itself is not part of the hex value.
This tool converts between text and hexadecimal using JavaScript's charCodeAt() function, which returns Unicode code points. For standard ASCII characters (code points 0-127), conversion is straightforward. For extended characters with code points above 127, the hex output will show values larger than 7F.
Hex-to-ASCII conversion is used in network packet analysis (Wireshark), debuggers and memory inspectors, encoding binary data for transmission, working with file headers and magic numbers, cryptography and hash functions, assembly language programming, and reverse engineering.