All Tools

Text to Hex Converter, Free and Private

Convert text to hexadecimal byte codes and hex back to text in your browser. UTF-8 aware, upper or lower case, any separator. Nothing is uploaded.

Direction
Base
Separator

0 characters, 0 bytes

0 characters, 0 bytes


About converting text to hex

This page converts text to hexadecimal byte codes and hex back to text, in your browser. Hex is the language of byte dumps, escape sequences, colour codes, network captures and debugger output, two digits per byte. Type or paste text and its UTF-8 bytes appear as hex on the right; paste hex and the text comes back. Nothing is uploaded, and your text never leaves your device.

How to convert text to hex

Steps

  1. Hex is pre-selected on this page. Type or paste your text on the left.
  2. Choose a Separator: a space between bytes is the usual dump style; None gives a continuous string such as 48656c6c6f; Comma suits a list; Newline puts one byte per line.
  3. Turn on Upper case if the destination expects 48 65 6C rather than 48 65 6c.
  4. Press Copy, or press Swap to move the hex into the input and check that it decodes back to the same text.

Hex to text

Switch Direction to Codes to text and paste the hex. The decoder accepts spaces, commas and line breaks between bytes, 0x prefixes on each byte, and an unbroken run of digits, which it cuts into pairs. A pair that is not valid hex is reported with its position. Hex that decodes to bytes which are not valid UTF-8 is reported as well, which usually means the data was a binary file rather than text.

Privacy

Everything happens in your browser. Your text is never uploaded to our servers and nothing is kept once the tab closes.

Reading hex

Two digits per byte

Each byte has 256 possible values, which is exactly two hexadecimal digits from 00 to ff. That is why hex is the standard way to show bytes: it is a quarter the length of binary and lines up neatly in columns.

UTF-8 bytes

Letters, digits and punctuation from the English keyboard are one byte each, so A is 41. An accented letter is two bytes, for example é is c3 a9, and most emoji are four bytes. The converter always shows the UTF-8 bytes, which is what browsers, APIs and modern programming languages use.

Escape sequences

Many languages write bytes as \x48 or %48. Remove the \x or % prefixes, or replace them with spaces, and the decoder reads the remaining pairs.

Common uses

  • Checking what a string looks like as bytes before writing it to a protocol or a file.
  • Decoding hex from a packet capture, a log or a database dump.
  • Producing \x-style escape sequences for a test fixture.
  • Comparing two strings that look the same but have different bytes, such as a plain and an accented character.

Related tools

The full Text to Binary converter also writes bytes as binary and decimal codes, and the Binary to Text page decodes ones and zeros. For a shorter text form of bytes see the Base64 Encoder; for %20-style URL escapes see the URL Encoder and Decoder.

Other related tools