Text to Hex Converter

Convert text to hexadecimal and back, using UTF-8 bytes so every character encodes correctly.

12Characters
12UTF-8 bytes
24Hex digits

Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.

What the Text to Hex Converter does

Use this text to hex converter to convert text to hexadecimal and back, using UTF-8 bytes so every character encodes correctly. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for decoding a hex string from a log or a debugger. There are more free online tools on FreeToolStation.org.

How to use it

  1. Pick a direction.
  2. Paste the text or the hex string.
  3. The decoder tolerates whitespace and 0x prefixes.
  4. Copy the result.

How it works

Hexadecimal is the standard way of writing bytes because each byte is exactly two hex digits, making the boundaries unambiguous without separators. Binary needs eight digits per byte and grouping to stay readable; hex needs neither.

A hex string of text has twice as many characters as it has bytes, which is why hex encoding is a 100% size overhead — worse than base64's 33%. Hex is used where readability and byte alignment matter more than size: hashes, keys, memory dumps, colour codes.

The decoder here ignores whitespace and accepts an optional 0x prefix, so hex copied from a dump or a debugger usually pastes in without cleaning up first.

When to use it

  • Decoding a hex string from a log or a debugger.
  • Encoding text as hex for a protocol or config value.
  • Inspecting the bytes behind a string.
  • Working through an encoding exercise.

Common mistakes to avoid

  • Pasting an odd number of hex digits, which cannot form whole bytes.
  • Confusing a hex-encoded string with a hash. Encoding is reversible; hashing is not.
  • Assuming hex is more compact than base64. It is substantially less so.

Frequently asked questions

How do I convert text to hex?

Each UTF-8 byte becomes two hex digits. "Hi" is 48 69.

Why use hex instead of base64?

Hex is byte-aligned and trivially readable — two digits per byte, no padding. Base64 is more compact but harder to read and align.

Is a hex string the same as a hash?

No. A hash is usually displayed as hex, but hashing is one-way and lossy while hex encoding is a reversible notation.

Related tools

See all text & writing tools →