Text to Hex

  • Free forever
  • No sign-up
  • Runs in your browser
Processed on your device

Convert text to hexadecimal (hex) bytes in UTF-8, with the format you need: spaces, 0x, \x or %.

About Text to Hex

Developers use it to prepare byte strings for code, test data and URLs, and to see exactly how a character is stored. The six formats cover plain spaced hex for notes and logs, 0x lists for C-style arrays, backslash-x escapes for scripts and percent signs for web addresses. Each character is converted to its UTF-8 bytes, with capital or lowercase hex digits.

How to use Text to Hex

  1. Type or paste your text into the Your text box.
  2. Choose a Format, such as 48 69 with spaces, 0x48, \x48 or %48 for URLs.
  3. Untick Capital letters (A-F) if you'd rather have lowercase hex digits.
  4. Copy the hex from the Result box, or click Download .txt to save it.

How your data is handled

The hex is created in your browser. Your text isn't uploaded or stored, and the .txt download is made on your device.

How SAA Tool works · Privacy Center

Limits and accuracy

  • Hex is always UTF-8; if a system expects UTF-16 or another encoding, characters beyond basic English won't match.
  • The percent format encodes every character, letters included, so it's longer than normal URL encoding from the URL Encoder.

Questions and answers

What is "Hello" in hex?

In UTF-8 hex, "Hello" is 48 65 6C 6C 6F. Each basic English character becomes one byte, written as two hex digits.

Which hex format should I choose?

Use 0x48 for arrays in C, Java or JavaScript, \x48 for byte strings in Python or shell scripts, and %48 for URLs. Spaces or colons are easiest to read in notes and logs.

Why does one emoji turn into several hex bytes?

UTF-8 uses one byte for basic English letters but two to four bytes for accented letters, other scripts and emojis. The 👋 emoji, for example, is four bytes: F0 9F 91 8B.

Do I need to sign up?

No. Text to Hex Converter is free with no sign-up, no login and no daily limit, and there's nothing to install. It works on a phone as well as a PC.

Is my text sent to a server?

No. Text to Hex Converter runs in your browser, so what you paste stays on your device. That makes it safe for passwords, tokens, customer data and anything else private.

Is this the same as a hex colour code?

No. This converts text to its hexadecimal character codes ('Hi' becomes 48 69). For colour codes, use the HEX to RGB converter.

Sources and standards

Report a problem with this tool