Free converter

Text to Hex Converter

Type text to get its hex bytes and decimal codes, or paste hex to turn it back into text. UTF 8 is used, so emoji and accents work.

Report a problem or suggest a fix for this tool

Quick answer: Type text and get its hexadecimal bytes. Hi becomes 48 69. You can choose a separator and decode hex back to text.

What is text to hex converter?

Every character is stored as one or more bytes. Hexadecimal writes each byte with two digits from 0 to F, which is shorter than binary and common in programming.

This tool shows hex and decimal ASCII codes, and it can reverse hex into readable text.

How to use the text to hex converter

  1. Choose text to hex or hex to text.
  2. Type or paste your input.
  3. Press Convert and copy the result.

How the text to hex converter works

Text is encoded as UTF 8 bytes. Each byte is written in base 16 with two digits. For decoding, pairs of hex digits are read as bytes and decoded as UTF 8.

Worked example

The text Hi becomes 48 69 in hex, because H is 72 (48 in hex) and i is 105 (69 in hex).

Common uses of the text to hex converter

  • Debugging network or file data.
  • Learning encoding.
  • Writing color or byte values.
  • CTF puzzles.
  • Checking character codes.

Tips and common mistakes

Use two digits per byte. A is 41, not 4.1.

Accents and emoji use several bytes in UTF 8.

For zeros and ones use the text to binary converter.

Background: what to know before you rely on it

Hex is a compact way to show bytes, which is why memory dumps, color codes and file signatures use it. Two hex digits make exactly one byte, so conversion between hex and bytes is direct.

Private, free and fast

This tool runs in your browser. What you type or choose is not sent to a server and is not saved after you close the page. No sign in is needed. It is free to use as often as you like. See more in all converters, or browse the full list of tools.

Field by field guide

  • Direction: Choose one of: Text to hex; Hex to text.
  • Input: Type or paste your text here. Use a new line for each entry where the label says so.
  • Separator: Choose one of: Space; None; Comma; 0x prefix.

Change one field at a time to see how the result responds, and use the worked example above to check that you get the same answer.

Text as hexadecimal

Each character is shown as its UTF8 bytes in hexadecimal. The letter A is 41 and a space is 20.

Practical scenarios

  • Debugging a string that has a hidden character.
  • Learning how encodings work.
  • Preparing a value for a protocol that needs hex.

Common mistakes

  • Expecting one byte per character. Letters outside basic English use two to four bytes.
  • Mixing hex and decimal codes.
  • Treating hex as encryption. It is only a different way to write the same data.

Hex and text encoding

Computers store text as numbers. Hexadecimal is a compact way to write bytes, with two hex digits per byte, so the word Hi is 48 69.

Expert tips

  • Use hex to inspect unusual characters, such as a non breaking space shown as C2 A0 in UTF8.
  • Remember that characters beyond basic English use several bytes, so a single emoji can be four bytes.
  • Group bytes in pairs when reading, and ignore spaces between them.
  • Use hex when debugging network protocols and file headers.
  • Convert back to text only with the same encoding that was used.

Hex is a notation, not a security measure. It reveals nothing and hides nothing.

Hex is the same bytes written in base 16

Text to hex does not change the data, it only writes each byte as two base 16 digits. The letter H is 72 in decimal, 01001000 in binary and 48 in hex, all the same byte. That is why developers use hex to inspect text, colors and network data. Non English characters and emoji use several bytes in UTF 8, so they give several hex pairs. Decoding fails when a pair is missing a digit or contains letters beyond F.

Frequently asked questions

What is hex?

A base 16 number system that uses 0 to 9 and A to F.

Is it the same as ASCII?

ASCII codes for basic English letters match UTF 8. Other characters use several bytes.

Why does decoding fail?

The input needs an even number of hex digits and only 0 to 9 and A to F.

Is my text saved?

No.

How do I convert ASCII text to hex?

Look up the code of each character and write it in base 16, or paste the text into the tool. For example, A is 41 and a is 61. The tool does this for the whole text at once.

What is the hex code for a space?

A space is 20 in hex, which is 32 in decimal. It is a real character, so it appears in the output between words.

Why does my hex not decode?

Hex input needs pairs of digits from 0 to 9 and A to F, and the bytes must form valid UTF 8 text. A single digit, an extra letter or cut off data makes decoding fail.

What is the hexadecimal base?

Hexadecimal is base 16. It uses the digits 0 to 9 and the letters A to F for the values 10 to 15, so one byte fits in exactly two hex digits.

How do I convert the alphabet to hexadecimal?

Each letter has a character code. Capital A is 41, B is 42 and Z is 5A in hex, while lowercase a is 61 and z is 7A. Type the letters into the tool to see every code at once.

Embed this tool on your website

Copy the code below and paste it into your page or blog post. The tool is free to embed, runs in the visitor's browser and needs no account. Please keep the credit link.

Related tools

Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Check critical conversions with an official source.