Text to Hex

Reading a memory dump, checking what a protocol really put on the wire, unpicking a CTF puzzle: sooner or later you need the bytes behind a string. Paste text and this converter returns it byte by byte in hexadecimal, either spaced like a hexdump (48 65 6c 6c 6f) or as one unbroken run (48656c6c6f). Switch the mode and it goes the other way, turning pasted hex back into readable text.

How the converter works

  1. 1

    Pick a direction

    Text to Hex encodes what you type. Hex to Text decodes hex back into characters.

  2. 2

    Choose a separator

    When encoding, put a single space between bytes or run them together. Those are the two options.

  3. 3

    Paste your input

    Text is read as UTF-8. Hex may arrive with 0x or \x prefixes, commas, spaces or line breaks: they are stripped for you.

  4. 4

    Convert and copy

    The result appears underneath with a copy button. Nothing is downloaded.

Why hex and not decimal

One hex digit covers exactly 4 bits, so two hex digits cover exactly one byte, every time. Decimal makes you do arithmetic to know whether a value still fits (is 128 in range? is 256?), while hex shows it: 00 is the smallest byte, ff is the largest, and every byte in between is two characters wide. That alignment is why hex is the notation of memory dumps, packet captures, file signatures and colour codes.

What this converter actually produces

  • Always lowercase. The encoder writes 6c, never 6C. Hex is case-insensitive, so nothing is lost, but if your target format demands capitals, run the output through a case converter.
  • Always two digits per byte. A tab is 09, not 9, so byte boundaries stay countable.
  • Space or nothing. Those are the only two separators. There is no 0x or \x prefix on the encoding side, so add those in your editor if you need C or Python escape strings.
  • UTF-8 throughout. Text is measured in bytes, not in characters.

Hex and Unicode

H takes one byte in UTF-8, so it becomes 48. Anything outside plain ASCII takes more:

Character UTF-8 hex Bytes
A 41 1
é c3 a9 2
€ e2 82 ac 3
🚀 f0 9f 9a 80 4

So Hello encodes to 48 65 6c 6c 6f, five characters and five bytes, while café encodes to 63 61 66 c3 a9: four characters but five bytes, because the é needs two. If a short string produces more hex pairs than you expected, that is usually the reason.

What the decoder accepts

Paste any of these and you get Hello back:

  • 48 65 6c 6c 6f, hexdump style
  • 48656c6c6f, raw with no separators
  • 0x48656c6c6f, integer-literal style
  • \x48\x65\x6c\x6c\x6f, C and Python escapes
  • 48,65,6C,6C,6F, comma-separated, in any mix of upper and lower case

Prefixes, commas, spaces, tabs and line breaks are removed before decoding. Anything else is not: a hyphen in 48-65, a # in front of a colour code, or a stray letter past f will stop the decode, and so will an odd number of digits, because half a byte cannot become a character. In those cases the tool returns nothing at all rather than guessing at a partial result. If the output area stays empty, that is the reason to look for.

Hex colours are the same notation, not the same content

#ff8800 uses the identical base-16 system, but those three bytes describe red, green and blue channels rather than characters. Strip the # and decode it here and you will get three raw bytes that are not readable text. Use a colour picker for those instead.

Frequently Asked Questions

Yes. Hexadecimal and base16 are two names for the same system: sixteen digits (0-9 and a-f), each carrying 4 bits.

Not from this tool. The encoder always writes lowercase. Because hex is case-insensitive, 4f and 4F are the same byte, so pass the result through any case converter if your format requires capitals. The decoder reads both cases without complaint.

The decoder only accepts the digits 0-9 and a-f in an even count, after it has removed 0x and \x prefixes, commas and whitespace. A hyphen, a #, a letter past f or one missing digit leaves the input invalid, and the tool prefers an empty result to a wrong one. Count your digits and look for stray punctuation.

Most emoji sit in the supplementary planes of Unicode, which UTF-8 stores in four bytes. Plain ASCII characters keep to one byte each, which is why English text maps one pair per character and other scripts do not.

No. This is a text field, so it handles what you can type or paste. For binary payloads base64 is both more compact and easier to transport.

Yes. The conversion runs on our server, so what you paste travels with the request and the result travels back. We record only the action and the options you picked, never the text itself, and the text is not stored after the response. For genuinely secret material, use a converter that runs offline on your own machine.

Related Tools

Tool available in other languages