Text to hexadecimal converter

Convert text to the hexadecimal values of its bytes. Choose the separator, capital or small letters and whether to add 0x in front of every byte. Everything runs in your browser and nothing is uploaded.

Separator
Letters

How it works

  1. Paste your text

    Type or paste the text in the left box, or open a .txt file. No text to hand? Click Example.

  2. Instant result

    The result appears as you type. Change the options and see straight away what changes.

  3. Copy or download

    Copy the result with one click, save it as a file or use it as input for a next step.

Example

Hello é😀 becomes 48 65 6C 6C 6F 20 C3 A9 F0 9F 98 80: five letters and a space of one byte each, é as C3 A9 and the emoji as four bytes. The note says the text is 12 bytes in UTF-8.

Options

  • Separator: a space, nothing or a colon (48:65:6C, as in MAC addresses).
  • Letters: A–F or a–f.
  • With 0x in front: for source code, such as 0x48, 0x65.

Why hexadecimal?

One hexadecimal digit stands for exactly four bits, so a byte is always two digits. That makes hex a compact and readable way to inspect data, as in network traces, file headers, escape sequences and colour codes.

Character Hex Decimal
A 41 65
a 61 97
0 30 48
space 20 32

To decode, use hex to text. For the bits themselves, see text to binary, and for the numbers per character text to ASCII.

Frequently asked questions

Why does é become C3 A9?

The text is encoded as UTF-8, where the letter é takes two bytes, C3 and A9. Plain ASCII characters are one byte, so `H` is `48`.

How do I get a 0x prefix and colons?

Tick *With 0x in front* and choose *Colon* as the separator: `Hi!` becomes `0x48:0x69:0x21`. Choose *a–f* for small letters.

What is the relation with percent-encoding in URLs?

A URL writes the same bytes with a percent sign: `é` is `%C3%A9`. See [URL encode](/en/code/url-encode) to convert text for a link.

Is hexadecimal the same as ASCII?

No. ASCII is a table of characters with numbers, and hexadecimal is one way to write those numbers. `A` is 65 in decimal, 41 in hexadecimal and 01000001 in binary.