Home / Encoders & Decoders

ASCII to Hex Converter

Runs locally in your browser. Your input is not uploaded.

An ASCII to hex converter shows the byte representation of text using hexadecimal digits. It is useful when inspecting protocol payloads, checking file bytes, preparing escaped byte sequences, or comparing text with a byte-oriented specification.

Despite the page name, this tool is not limited to ASCII. Text is encoded as UTF-8, so ordinary ASCII characters use one byte while accented letters, non-Latin scripts, and emoji can use multiple bytes. The reverse mode can decode bytes as strict UTF-8 or map each byte directly with Latin-1.

How to Use the ASCII to Hex Converter

Convert text to hex bytes, or switch direction to inspect existing byte values.

  1. Select Text to hex in the Mode control.
  2. Enter content in the Text field.
  3. Choose Space, None, Colon, Comma, or New line from Separator.
  4. Choose None, 0x, or \x from Prefix, and enable Uppercase if needed.
  5. Read the live result in Hex bytes, then select Copy to copy it.
  6. Select Hex to text to reverse the conversion, enter values in Hex bytes, and choose UTF-8 (includes ASCII) or Latin-1 (ISO-8859-1) from Decode as.
  7. Select Swap to move the current output into the input and change direction.

ASCII, UTF-8, and Hexadecimal Bytes

ASCII assigns numeric values from 0 through 127 to letters, digits, punctuation, and control characters. Hexadecimal is simply a compact way to write those values: decimal 65 is hex 41, so the ASCII letter A becomes one byte written as 41.

UTF-8 preserves that same single-byte representation for ASCII. Characters outside ASCII are encoded with two to four bytes. For example, this tool produces two bytes for é and three for ✓:

A  → 41
é  → c3 a9
✓  → e2 9c 93

That distinction matters when a protocol specifies bytes rather than Unicode code points. The code point for é is U+00E9, but its UTF-8 bytes are c3 a9; entering e9 and decoding it as UTF-8 fails because that single byte is not a complete UTF-8 sequence. Use the string inspector when you need to compare code points, UTF-8, and UTF-16 representations.

Separators, Prefixes, and Accepted Hex Input

The output controls change presentation, not the bytes. Separator can place a space, colon, comma and space, or line break between bytes, or join them without a delimiter. Prefix can add 0x or \x to each byte, while Uppercase changes the hexadecimal digits from forms such as c3 to C3.

Hex to text accepts paired hexadecimal digits with optional 0x or \x prefixes. It also ignores whitespace and the comma, colon, semicolon, and hyphen characters, so inputs such as 48 69, 48:69, 0x48, 0x69, and \x48\x69 decode to the same two bytes.

Each byte must still contain exactly two hex digits. An unsupported character produces an error, and an odd number of digits is rejected rather than guessed. If input comes from a packet dump or debugger, remove addresses, ASCII sidebars, brackets, and other annotations before decoding.

UTF-8 vs. Latin-1 Decoding and Common Mistakes

UTF-8 (includes ASCII) uses a strict UTF-8 decoder. It rejects incomplete sequences, isolated continuation bytes, and other invalid byte patterns. This is helpful when the source is expected to be modern text because malformed data is reported instead of silently replaced with a placeholder character.

Latin-1 (ISO-8859-1) maps every byte from 00 through ff to one character, so decoding does not fail. It can reveal legacy single-byte text, but selecting it does not detect the original character encoding. The same bytes can display differently under Windows-1252, UTF-8, or another legacy encoding, and this tool offers only UTF-8 and Latin-1.

A common mistake is assuming that a hex string describes text at all. It may represent compressed data, an image, encrypted bytes, or a hash. Another is confusing hexadecimal byte encoding with an integer written in base 16. This tool processes pairs of bytes in order; for arbitrary-size number conversion, use the number base converter.

Privacy, Security, and Byte-Accurate Handling

The conversion runs locally in the browser, and the tool does not upload the entered text or hex data. That is useful for routine inspection, but secrets should still be redacted before copying output into tickets, chat messages, logs, or shared screenshots.

Hex is an encoding, not encryption. Anyone with the output can recover the original bytes, and converting a password, token, or private value to hex does not protect it. If you need a one-way digest for comparison, use the hash generator and choose the algorithm required by the surrounding system.

Keep the original bytes when exact preservation matters. Decoding bytes to text and encoding them again is safe only when the correct character encoding is known and the decoder accepts the input. Binary data should remain binary rather than being forced through a text representation.

Frequently Asked Questions

Is ASCII to hex the same as UTF-8 to hex?

They are the same for ASCII characters because UTF-8 uses the ASCII byte values unchanged. They differ for characters outside the ASCII range, which UTF-8 represents with multiple bytes. This tool uses UTF-8 for Text to hex, so its practical behavior is broader than the page name.

Why does one character produce several hex bytes?

UTF-8 uses a variable-length encoding. ASCII characters take one byte, while other Unicode code points take two, three, or four bytes. A visually combined character can also consist of multiple code points, so what looks like one symbol may produce more than one encoded sequence.

Can I paste hex with 0x or \x prefixes?

Yes. Hex to text removes either prefix and accepts whitespace, commas, colons, semicolons, and hyphens as separators. Other annotations are not supported, and the remaining hexadecimal digits must form complete two-digit bytes.

Why are my hex bytes rejected as invalid UTF-8?

The byte sequence may be incomplete, malformed, binary, or encoded with a different character set. Try Latin-1 only when a one-byte mapping is appropriate; it will map every byte, but that does not prove the source was actually ISO-8859-1. Confirm the source encoding rather than treating any readable result as authoritative.

Does uppercase hex change the value?

No. Hexadecimal digits are case-insensitive, so ff and FF represent the same byte. Uppercase, prefixes, and separators are formatting choices for compatibility or readability and do not alter the underlying byte values.

References: RFC 3629: UTF-8, a transformation format of ISO 10646 · WHATWG Encoding Standard: UTF-8.