consolelog.tools

Text to Hex

Convert text to hexadecimal using real UTF-8 — emoji and accented or CJK characters are byte-correct. Live, with case, separator and 0x options plus an xxd-style hex dump.

About this ToolHow it works, benefits & use cases

Convert any text into its hexadecimal byte representation using real UTF-8 encoding, so emoji, accented letters, and CJK characters produce byte-correct hex rather than truncated values. You control the output format precisely: choose lowercase or uppercase hex digits, pick a separator (none, space, colon, comma, or one byte per line), and optionally prefix every byte with "0x". A live UTF-8 byte count updates as you type, and an xxd-style hex dump panel shows the offset, hex columns, and an ASCII gutter so you can read the raw bytes alongside the formatted output. Because the encoding is true UTF-8 — built on TextEncoder — a four-byte emoji yields four hex bytes, exactly matching what a server or file would store. One click swaps you to the Hex → Text decoder to round-trip the result, and the whole conversion is captured in a shareable URL. Everything runs locally in your browser with no upload.

How to Use

  1. 1Open Output format and pick a separator (none, space, colon, comma, or newline) and lowercase or uppercase digits.
  2. 2Optionally tick "0x prefix" to prepend 0x to each byte.
  3. 3Type or paste your text into the input — the hex output and a UTF-8 byte count update live.
  4. 4Click "Convert to Hex" to confirm, and check the xxd-style hex dump below to inspect the bytes.
  5. 5Copy or download the hex, share the link, or click "Swap to Hex → Text" to reverse it.

Key Benefits

  • True UTF-8 encoding — emoji, accents, and CJK become byte-correct hex
  • Choose none, space, colon, comma, or newline separators
  • Lowercase or uppercase hex digit output
  • Optional 0x prefix on every byte
  • Live UTF-8 byte count as you type
  • Built-in xxd-style hex dump with offsets and an ASCII gutter
  • One-click swap to the Hex → Text decoder and a shareable URL

Common Use Cases

  • Producing a byte-accurate hex representation of a UTF-8 string for tests
  • Generating colon- or space-separated hex for documentation or wire formats
  • Checking how many bytes a string occupies in UTF-8
  • Creating a 0x-prefixed byte list to paste into source code
  • Inspecting the exact bytes of multi-byte characters while debugging

Output format

Prepend 0x to every byte (e.g. 0x48 0x65)

0 UTF-8 bytes · live

Enter text above to see its hexadecimal form.

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Related tools