3tej home

What is Text to Hex Converter?

A Text to Hex Converter converts Text into Hex directly in your browser. It parses the source format, applies the standard mapping or formula, and outputs the target format ready to copy. Encode any text as a lowercase hex byte sequence (UTF-8).

Text to Hex Converter

Convert any text to hexadecimal byte sequence. UTF-8 aware.

🔒 Browser-only ⚡ Instant 💸 Free forever 📡 Works offline 🚫 No signup
← Utilities

TLDR

Type text, click Convert. Each character is encoded as UTF-8 bytes, then each byte becomes 2 hex digits. Spaces between bytes for readability.

Runs entirely in your browser. No upload, no signup, no logging. Output is for personal or commercial use; we don't claim any rights.

About the text to hex converter

This tool encodes any text as a sequence of hexadecimal byte values. Hexadecimal, or base 16, is the notation engineers use to read raw bytes, because each byte maps cleanly to exactly two hex digits. You reach for text-to-hex when inspecting a hex dump, building or debugging a binary protocol, embedding a string in firmware or a config file that expects hex, or checking exactly which bytes a piece of text produces. It is the same view you get from command-line tools like xxd or hexdump, but a paste away.

The conversion uses UTF-8, the dominant text encoding on the web, so plain ASCII letters become one byte each while accented letters and emoji expand to several. Everything runs locally with the browser's TextEncoder, so your text is never uploaded or logged.

How the encoding works

Two steps turn text into hex. First the string is encoded to bytes with UTF-8, then each byte is formatted as a zero-padded two-digit base-16 number.

bytes = TextEncoder().encode(text)
hex = bytes.map(b => b.toString(16).padStart(2, '0')).join(' ')

The padStart keeps single-digit values like 0x9 written as 09, so the stream stays in clean two-character groups. To reverse the process, split the hex into pairs, parse each as base 16, and decode the bytes back with UTF-8.

Worked example

Encode the word Hi! to hex.

  1. H is byte 72 in decimal, which is 48 in hex.
  2. i is byte 105 in decimal, which is 69 in hex.
  3. ! is byte 33 in decimal, which is 21 in hex.
"Hi!"  ->  48 69 21

Every character here is plain ASCII, so each maps to a single hex pair. Add an emoji and you would see four hex pairs for that one character, because UTF-8 stores it in four bytes.

ASCII to hex reference

CharacterDecimalHex
space3220
04830
A6541
a9761
accented etwo bytesc3 a9

Common mistakes and pitfalls

  • Assuming one character equals one byte. That holds only for ASCII. Accented letters take two bytes and most emoji take four under UTF-8, so they produce multiple hex pairs.
  • Mixing up case. This tool emits lowercase hex. Some systems expect uppercase. The values are identical, but a strict parser may care.
  • Dropping the zero pad. Byte 9 must be written 09, not 9. Unpadded hex misaligns the pairs and breaks decoding.
  • Confusing hex with a code point. The hex here is the UTF-8 byte sequence, not the Unicode code point. The euro sign is code point U+20AC but its UTF-8 bytes are e2 82 ac.
  • Forgetting the encoding when decoding. To read hex back as text you must decode the bytes as UTF-8; treating them as a single-byte encoding garbles non-ASCII characters.
  • Whitespace in the input counts. Spaces and line breaks are real characters and produce their own hex bytes, so trim the input if you do not want them encoded.

Frequently asked questions

How does text get converted to hexadecimal?

The text is first encoded to bytes using UTF-8, then each byte is written as a two-digit base-16 number from 00 to ff. So the letter A, byte value 65, becomes 41 in hex. The output is the bytes laid out in order, which is exactly how hex dumps and many file formats represent text.

Why is each byte two hex digits?

A byte holds 8 bits, and each hexadecimal digit encodes 4 bits, so two hex digits cover the full range of one byte from 00 to ff, that is 0 to 255 in decimal. Padding every byte to two digits keeps the output aligned and unambiguous when decoding back to text.

How are emoji and accented characters encoded?

Under UTF-8 any character outside basic ASCII uses two to four bytes, so it produces several hex pairs rather than one. The accented e for instance is two bytes, c3 a9, and most emoji are four bytes, giving eight hex digits. ASCII characters stay a single byte and one hex pair.

Is the hex output uppercase or lowercase?

This tool outputs lowercase hex, so the digits a to f appear in lowercase, such as ff and c3. Uppercase and lowercase hex are numerically identical; the choice is purely stylistic. If a system you are pasting into expects uppercase, convert the letters after copying.

Is my text sent anywhere?

No. The encoding runs entirely in your browser using the TextEncoder API, so your text is never uploaded, logged, or stored. The page works offline once loaded, which makes it safe to encode private strings, tokens, or notes.