Text to Hex Converter

Convert any text string to its hexadecimal representation

Input Text
Hexadecimal Output
48656c6c6f20576f726c64

What is Text to Hex Conversion?

Hexadecimal (hex) is a base‑16 numeral system that uses digits 0‑9 and letters A‑F. Each character in a text string has an ASCII (or Unicode) code point, which can be expressed as a two‑digit hexadecimal number. For example, the letter 'A' has ASCII code 65, which in hex is 41. Converting text to hex is useful for debugging binary data, encoding for low‑level protocols, and preparing data for embedded systems.

This tool transforms any text (including letters, numbers, and symbols) into a continuous hex string. Each byte (character) is represented by exactly two hex digits, making it easy to transmit or store binary‑safe data.

How to Use This Tool

Step 1: Enter your text in the left input field. You can paste from any source or type directly.
Step 2: Optionally check “Uppercase hex” to output letters A‑F in uppercase (default is lowercase).
Step 3: Check “Space between bytes” if you want each byte separated by a space (e.g., "48 65 6c 6c 6f").
Step 4: Click “Convert to Hex”. The hexadecimal result appears instantly.
Step 5: Use the “Copy Hex” button to copy the result to your clipboard.

This tool works with any ASCII text. For extended Unicode characters, it will produce the corresponding UTF‑8 byte sequence (multiple bytes per character).

Examples

Text: "Hello"
Hex: 48656c6c6f
With spaces: 48 65 6c 6c 6f

Text: "ToolGram"
Hex: 546f6f6c4772616d

Text: "123"
Hex: 313233

Who Uses Text to Hex Conversion?

  • Programmers – encoding strings for binary protocols, debugging network packets, or working with low‑level APIs.
  • Security Researchers – analyzing binary data and hex dumps.
  • Embedded Engineers – preparing data for microcontrollers that accept hex input.
  • Students – learning how characters are represented in computers.
  • Web Developers – converting strings for CSS color codes or other hex‑based formats.

Pro Tips

  • Use uppercase hex if you need to match a specific format (common in some programming languages).
  • The “space between bytes” option makes the output easier to read, especially for long strings.
  • You can convert the hex back to text using our Hex to Text converter (available in related tools).
  • Remember that each character becomes two hex digits – the length of the hex output is exactly twice the number of bytes in the input.

Frequently Asked Questions

Does this tool support Unicode (emojis, non‑English characters)?
Yes. It uses JavaScript’s `TextEncoder` which encodes the text as UTF‑8. Each character may be represented by 2, 3, or 4 bytes, and those bytes will be output as hex. For example, the emoji “😀” becomes “f09f9880”.
Why would I need text to hex conversion?
Hex representation is often required for APIs that expect binary data in text form, for storing passwords in a hex‑encoded format, or for preparing data for hardware that only accepts hex strings (e.g., some IoT devices).
Can I convert hex back to text with this tool?
No, this tool is one‑way. For the reverse operation, use our dedicated Hex to Text converter (see related tools).
Is my data sent to a server?
No, all conversion happens locally in your browser. Your text never leaves your device.