araç köşesi

Text to Hex and Hex to Text

Turn text into the hexadecimal form of its bytes, or decode a hex string back into readable text

Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.

How it works

Paste text or hex into the left box; the tool reads the input, decides the direction and shows the result on the right. Type "Café £5" and UTF-8 gives 43 61 66 C3 A9 20 C2 A3 35: seven characters become nine bytes, because é (C3 A9) and £ (C2 A3) take two bytes each. The result line spells this out, for example "é" = C3 A9 (2 bytes). The other way round, paste 48 65 6C 6C 6F and you read "Hello". Spaces, commas, colons, dashes and 0x or \x prefixes in a hex string are stripped, so 0x48,0x69 and 48 69 give the same result. If the string has an odd number of digits, or a letter that is not hex such as G or Z, the tool does not guess; it tells you at which position the problem is. If hex copied from a database dump, a network capture or an error log contains a broken UTF-8 byte, that byte is shown as � and its position appears in the result line. Words made only of the letters A–F, such as "cafe" or "face", are treated as words, not hex; if the direction is still guessed wrong, set "Direction" by hand.

This tool is also known as text to hex, hex to text, hex to ascii, hex decoder, string to hex converter.

What is Hex (hexadecimal)?

Hexadecimal is base 16: the digits 0–9 plus the letters A–F, where A is 10 and F is 15. One byte holds 256 possible values, and exactly two hex digits cover them all (00 to FF), which is why programmers, network tools and hex editors write bytes in hex. The number 255 is FF, 65 is 41 and 10 is 0A. Hex is only a way of writing numbers; it says nothing about which letter a byte stands for. That meaning comes from the character encoding.

What is UTF-8?

UTF-8 is the encoding used by almost every web page and modern text file. It writes each Unicode character in one to four bytes: the 128 ASCII characters in one byte, most accented Latin letters in two (é = C3 A9), the euro sign and most other symbols in three (€ = E2 82 AC) and emoji in four. Plain ASCII text is valid UTF-8 as it stands. A multi-byte sequence follows a fixed pattern, so a stray byte that breaks the pattern can be detected, which is how this tool finds and marks invalid bytes.

What is the difference between hex and an ASCII code?

An ASCII code is the number of a character, usually written in decimal: H = 72. Hex writes the bytes in base 16: the byte for H is 48, which is simply 72 in hex. For plain English letters both tell you the same number in different bases. They part ways with accented letters and symbols: é has code point 233 (hex E9), yet a UTF-8 file stores it as two bytes, C3 A9. If you need the character number, use the ASCII code converter on this site; if you need the bytes that actually sit in a file or travel over a network, this tool is the right one.

Same letter, different bytes: why the encoding changes the result

Hex writes bytes, not letters. The encoding decides which bytes a letter becomes. In UTF-8, plain English letters and digits take one byte (A = 41), accented letters such as é or ñ take two (é = C3 A9), the pound sign takes two (£ = C2 A3) and the euro sign takes three (€ = E2 82 AC). ISO-8859-1 (Latin-1) keeps every character in one byte but knows only 256 of them: é is E9 and £ is A3, but € does not exist, so converting text with € in Latin-1 gives an error.

UTF-16 writes each character in at least two bytes: A = 00 41, é = 00 E9, € = 20 AC. Windows uses it internally and Java strings use it too; this tool writes the bytes big-endian (BE). When decoding, a string that starts with FF FE or FE FF is taken as a byte order mark (BOM): it is skipped and the byte order follows it. Decode UTF-8 bytes with the wrong encoding and you get mojibake: é turns into "é" and £ into "£". If you see those, switch the encoding first.

  • A → 41 (one byte in UTF-8 and Latin-1, 00 41 in UTF-16)
  • é → C3 A9 (UTF-8) · E9 (Latin-1) · 00 E9 (UTF-16)
  • £ → C2 A3 (UTF-8) · A3 (Latin-1) · 00 A3 (UTF-16)
  • € → E2 82 AC (UTF-8) · not in Latin-1 · 20 AC (UTF-16)
  • C3 on its own → invalid UTF-8, shown as �

Which output style to use when

Spaced style (48 65 6C) is easiest to read and to count bytes in; use it while debugging or when you need to spot one byte by eye. Compact style (48656C) is what you see in URLs, hash values and database fields; its length is always even. The 0x style (0x48 0x65) is handy when you write a byte array in C, Python or JavaScript.

For hex → text you do not need to pick a style: the tool strips prefixes and separators and reads only the digits. Upper and lower case are the same, so 4a equals 4A. Output is always upper case, since most documents and tools write hex that way.

Frequently asked questions

How do I convert hex to text?

Paste the hex string into the left box; the tool sees that it is hex and shows the readable text on the right. Spaces, commas and 0x prefixes are fine. If the text shows broken characters such as "é" or "£", switch the encoding between UTF-8 and ISO-8859-1 and look again.

Why does é or £ take two bytes in hex?

UTF-8 stores the 128 basic ASCII characters in one byte each. Anything outside that set, such as é, ñ or £, needs two bytes, and € needs three. This is the rule of the encoding, not an error. The result line shows the first multi-byte character and its bytes separately.

What does the "odd number of digits" error mean?

Every byte is written as exactly two hex digits. If the string has an odd count, a digit was lost or added while copying, and the tool cannot guess which byte is half-written, so it stops. Check the source and fix the missing digit; the zero in a 0x prefix does not count.

Is the text I paste sent to a server?

No. The conversion runs entirely in your browser; text, passwords or database dumps you paste never leave this page and are not stored anywhere.