About the String to Hex
Convert text to the hexadecimal values of its UTF-8 bytes, with a choice of separator and upper or lower case.
Key features
- Converts text to hexadecimal UTF-8 bytes
- Separator: space, none, comma or new line
- Uppercase or lowercase hex digits
- Optional 0x prefix for code
- Full Unicode support, including emoji
- Instant and private
Text to hexadecimal
Every character you type is stored as bytes, and hexadecimal (base 16) is the standard way developers write bytes: two hex digits per byte, 00 to FF. Converting text to hex is essential for debugging encodings, writing protocol messages, inspecting binary formats and embedding byte arrays in code.
Example
Hello, World! becomes:
48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21
With uppercase and the 0x prefix, comma-separated:
0x48,0x65,0x6C,0x6C,0x6F,0x2C,0x20,0x57,0x6F,0x72,0x6C,0x64,0x21
ASCII hex reference
| Char | Hex | Char | Hex | Char | Hex |
|---|---|---|---|---|---|
| space | 20 | 0 | 30 | A | 41 |
! | 21 | 9 | 39 | Z | 5A |
, | 2C | @ | 40 | a | 61 |
. | 2E | _ | 5F | z | 7A |
| new line (LF) | 0A | carriage return (CR) | 0D | tab | 09 |
UTF-8 multi-byte characters
| Character | UTF-8 hex | Bytes |
|---|---|---|
A | 41 | 1 |
é | c3 a9 | 2 |
€ | e2 82 ac | 3 |
😀 | f0 9f 98 80 | 4 |
Use cases
- Debugging encoding problems: spot invisible characters such as non-breaking spaces (
c2 a0) or a BOM (ef bb bf). - Network protocols and IoT: craft byte payloads for serial ports, MQTT or BLE.
- Security and CTFs: decode and encode challenge data.
- Code: generate byte-array literals.
Related tools
Decode with Hex to String, view bits with String to Binary, or convert TOTP secrets with Base32 to Hex.
How to use the String to Hex
- Type or paste your text into the input box.
- Choose the options you want.
- The result updates instantly as you type.
- Copy the output or download it as a .txt file.