Shard Tools

Text to Hex

Convert text to hexadecimal in your browser.

Maintained by Roshan.

Use Text to Hex

Converts text to hexadecimal in this tab, with nothing sent anywhere.

Runs entirely on your deviceThe conversion happens in this browser tab. Nothing you type is uploaded, logged or stored, which is worth knowing for anything you would not paste into a search box.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About Text to Hex

Hexadecimal is how programmers read bytes, because two hex digits express one byte exactly and compactly where eight binary digits are unwieldy. Converting text to hex is a constant need when debugging: inspecting what a string really contains, spotting an invisible character that is breaking a parser, or preparing a value for a protocol that expects hex. As with binary, the trap is anything beyond plain English. A character is not always one byte, so this encodes the text as UTF-8 first and expresses each resulting byte as a two-digit hex value. That means an accented letter shows as its genuine two or three bytes, which is exactly what you need to see when a supposedly simple string is behaving strangely.

Using Text to Hex

  1. The text is encoded to UTF-8, so each character contributes the bytes it actually occupies.
  2. Each byte is written as two hexadecimal digits, always padded, so a byte value below sixteen still shows two characters.
  3. Bytes are space-separated for readability, though the reverse tool also accepts run-together and 0x-prefixed forms.
  4. Lower-case hex is used, which is the convention in most tooling, though the values are identical whatever the case.
  5. The output is a precise byte view of the string, nothing added or interpreted.

Where text to hex helps

Finding an invisible character

A string that looks right but fails a comparison often has a hidden character. The hex view shows every byte, so the stray value stands out.

Preparing a value for a protocol

Some low-level formats expect hex-encoded bytes. Convert here and paste the result.

Before you use the result

Questions about Text to Hex

Why hex instead of binary?

Two hex digits equal one byte and are far easier to read than eight binary digits. It is the standard way programmers view bytes.

Why is a simple letter two digits?

Because a byte is two hex digits by definition, and a value below sixteen is padded with a leading zero to keep the alignment.

Does it show hidden characters?

Yes, as their byte values. That is one of the main reasons to convert text to hex.

Can I convert it back?

Yes, with the hex to text tool, which accepts spaced, joined and 0x-prefixed hex.

Related tools

Hex to Text

Convert hexadecimal back to text in your browser. Accepts spaced, joined and 0x-prefixed hex.

Text to Binary

Convert text to binary in your browser. Each character becomes its UTF-8 bytes, grouped for readability.

Hex to Decimal

Convert a hexadecimal number to decimal in your browser, with full precision for large values.