BYTETOOLS

Text to Hex Converter

Convert UTF-8 text to a hexadecimal byte string with a choice of separators — space, none, 0x or \x prefixes — and an uppercase toggle. Free text to hex tool.

Hexadecimal

48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21

  • Encodes text as UTF-8 before converting
  • Separator options: space, none, 0x, \x
  • Uppercase or lowercase hex digits
  • Handles emoji and accented characters
  • Live output as you type
  • Private, client-side conversion

How to use the Text to Hex Converter

  1. 1

    Type or paste your text into the box.

  2. 2

    Pick a separator: space, none, 0x-prefix or \x-prefix.

  3. 3

    Toggle uppercase hex digits on or off.

  4. 4

    Read the hexadecimal output update instantly below.

  5. 5

    Copy the hex string to your clipboard.

About the Text to Hex Converter

The ByteTools Text to Hex Converter turns any text into its hexadecimal byte representation, encoding each character as UTF-8 first so emoji and accented letters convert correctly. It is a staple for developers, reverse engineers and anyone inspecting how text is stored as bytes.

Choose how the bytes are separated — plain spaces, no separator, 0x prefixes or \x escapes — and toggle uppercase or lowercase digits to match the format your code or tool expects. The hex updates live as you type.

All conversion runs locally in your browser with JavaScript, so nothing you enter is uploaded or stored. Copy the hex string to your clipboard in a single click.

Frequently asked questions

How is text converted to hexadecimal?

Each character is first encoded to one or more bytes using UTF-8, then every byte is written as a two-digit hexadecimal number from 00 to FF. For example the letter A is byte 65, which is 41 in hex.

Why does UTF-8 matter for hex conversion?

Characters beyond basic ASCII, like é or an emoji, take more than one byte in UTF-8. Encoding to UTF-8 first ensures every character maps to the correct byte sequence, so the hex round-trips back to the exact same text.

What do the 0x and \x prefixes mean?

Both mark a value as hexadecimal in source code. 0x is the common form in C, Java and JavaScript, as in 0x41, while \x is used inside strings, as in \x41. Choose whichever matches the language or tool you are pasting into.

Should I use uppercase or lowercase hex?

They represent the same values, so it is purely stylistic. Lowercase is common in web and Unix contexts, while uppercase is often seen in memory dumps and some documentation. The toggle lets you match the surrounding convention.

Can I convert the hex back to text?

Yes, use the companion Hex to Text tool. It accepts hex in any of these formats — with or without separators and prefixes — and decodes it back to UTF-8 text, so the two tools are a complete round trip.

Related tools