Skip to main content

ASCII to Hex

Convert ASCII text to hexadecimal byte representation. Encodes input as UTF-8 and outputs space-separated hex values.

Overview

The ASCII to Hex tool encodes text to hex bytes:
  • Input: Any text (ASCII, UTF-8, Unicode)
  • Output: Space-separated lowercase hex bytes
Encoding uses UTF-8, so multi-byte characters (emoji, accented letters) produce multiple hex values.

Use Cases

Protocol construction

Build hex payloads for network protocols or embedded systems

Data embedding

Encode strings as hex literals for C, assembly, or configuration files

Debugging

Inspect byte-level representation of text data

Cryptographic input

Prepare text for hex-based hashing or encryption tools

Input Format

Paste any text. Unicode and multi-byte characters are supported.
Example
Hello World

Output

Space-separated lowercase hexadecimal bytes with byte count metadata.
Input:
Hello
Output:
48 65 6c 6c 6f
Meta:
5 bytes (UTF-8)
Input:

Output:
e2 98 95
Meta:
3 bytes (UTF-8)
The coffee emoji (U+2615) encodes to 3 bytes in UTF-8.

Implementation Details

The tool uses TextEncoder to convert the input string to UTF-8 bytes, then formats each byte as a two-digit lowercase hex string. Source: lib/tools/engine.ts:962-966
Key logic
const bytes = new TextEncoder().encode(input);
return Array.from(bytes).map((b) => b.toString(16).padStart(2, '0')).join(' ');
The output is always lowercase hex. For uppercase, manually convert the output or use a text case tool.

Character Encoding

Single-byte characters map directly to hex:
  • A41
  • 030
  • \n0a
Characters like é, ñ encode to 2 bytes in UTF-8:
  • éc3 a9
Multi-byte characters (emoji, CJK, etc.) encode to 2-4 bytes:
  • 🔥 (U+1F525) → f0 9f 94 a5
For decoding hex back to ASCII, use the Hex to ASCII tool.

Keyboard Shortcuts

  • Cmd/Ctrl+Enter — Convert ASCII to hex
  • Cmd/Ctrl+Shift+C — Copy output
  • Cmd/Ctrl+Shift+S — Download output

Hex to ASCII

Reverse operation: convert hex bytes to ASCII text

Base64 String Encode/Decode

Encode/decode Base64 strings

String Inspector

Analyze byte length, encoding, and character frequency

Build docs developers (and LLMs) love