Skip to content
XUtilHub

String to Hex Converter – Text to Hexadecimal

Convert text to hexadecimal (UTF-8 bytes). Choose the separator and case. Free online text to hex converter.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

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

CharHexCharHexCharHex
space20030A41
!21939Z5A
,2C@40a61
.2E_5Fz7A
new line (LF)0Acarriage return (CR)0Dtab09

UTF-8 multi-byte characters

CharacterUTF-8 hexBytes
A411
éc3 a92
€e2 82 ac3
😀f0 9f 98 804

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.

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

  1. Type or paste your text into the input box.
  2. Choose the options you want.
  3. The result updates instantly as you type.
  4. Copy the output or download it as a .txt file.

Frequently asked questions

Why does é become two hex bytes?

Text is encoded as UTF-8, where ASCII characters use 1 byte and others use 2–4 bytes. é is C3 A9 in UTF-8; the emoji 😀 is F0 9F 98 80.

What's the difference between hex and ASCII codes?

For ASCII characters, hex is simply the ASCII code in base 16: 'A' is 65 in decimal and 41 in hex.

When would I use the 0x prefix?

When pasting bytes into source code, e.g. C, C++, Java, JavaScript or Python byte arrays: {0x48, 0x69}.

Can I convert hex back to text?

Yes, with the Hex to String tool.

Is my text sent anywhere?

No. All text tools run locally in your browser.

Do these tools support Unicode?

Yes. They handle Unicode text, including emoji and accented characters.

Last updated:

Related Text tools