Text to hex turns every character in your text into a pair of hexadecimal digits that represent the underlying UTF-8 bytes, so the letter "A" becomes 41 and the emoji 😀 becomes f09f9880. Each byte always uses exactly two characters (the digits 0–9 and the letters a–f), and the pairs sit end-to-end so a decoder can read them back as bytes. Beginners usually see two things at once: a long string of letters and numbers, and the names of the formats that produced it (continuous, space-separated, or 0x-prefixed). Both are honest representations of the same bytes; only the layout differs. The Text to Hex tool runs the TextEncoder API in your browser, so your input never leaves the tab and there is no upload, no account, and no silent rewriting. It also reports how many UTF-8 bytes were produced and warns you if any isolated surrogate code units were replaced with U+FFFD before encoding. Once you see how the byte count relates to the characters you typed, the rest of the workflow is just choosing a format and copying the result.

text to hex for beginners
Text to Hex for Beginners: A Plain-English Walkthrough

What "Text to Hex" Actually Means

Hexadecimal is a base-16 numbering system that uses the digits 0 through 9 and the letters a through f (or A through F) to represent values from 0 to 15. Two of those characters together cover one byte, which holds values from 00 to ff (0 to 255 in decimal). When you encode text to hex, you are not changing the text itself; you are taking the byte values that the computer already uses to store the text under UTF-8 and writing them out in a human-readable, copy-paste-friendly way.

For a beginner, the most useful mental model is this: every character has a Unicode code point (such as U+0041 for "A"), and that code point is encoded as a specific sequence of one to four bytes under UTF-8. The hex output is just those bytes printed two digits at a time. Because each byte is always exactly two characters, you can count the length of the output in continuous format and divide by two to recover the byte count.

How UTF-8 Decides the Output Length

The number of bytes a character uses depends on which Unicode range it lives in. ASCII is the cheapest, emoji and rare scripts are the most expensive. Beginners rarely need the full rules, but seeing the categories once makes the hex string stop feeling arbitrary.

Character type Byte count Example Hex bytes
Plain ASCII letter or digit 1 U+0041 "A" 41
Common accented Latin 2 U+00E9 "é" c3a9
Most BMP characters (Chinese, Korean, etc.) 3 U+4F60 "你" e4bda0
Supplementary characters (emoji, rare scripts) 4 U+1F600 "😀" f09f9880

You can mix and match freely. The phrase "Hi 😀" contains one ASCII letter (one byte), one ASCII letter (one byte), one ASCII space (one byte), and one emoji (four bytes), which works out to seven bytes total. If you counted 14 hex characters in continuous format, your count is consistent. The tool reports the exact byte count for you, so you do not have to do this arithmetic by hand.

Three Ways to Display the Same Bytes

The Text to Hex tool offers three output layouts and two letter cases. The bytes underneath never change; only their shape on screen does.

Format Example (bytes 48, 69) When it is useful
Continuous pairs 4869 Compact debugging logs, single-line output
Space-separated pairs 48 69 Reading bytes by eye, common in tutorials
0x-prefixed tokens 0x48 0x69 C, C++, Rust, and other source-code contexts

The lowercase or uppercase setting only affects the letters a through f; the digits 0 through 9 stay the same, and the lowercase "x" in the prefix stays lowercase. Switching format or case never changes the encoded UTF-8 bytes, but it does change the formatted output length, and that matters when you are close to the tool's output budget.

Convert Your First Text to Hex in the Browser

Open the Text to Hex tool in any modern browser. Everything runs locally through the TextEncoder API, so nothing is uploaded.

  1. Paste or type your text into the input field. You can include Unicode, whitespace, NUL bytes the field can hold, and emoji; the encoder treats them as data.
  2. Choose your output format: continuous pairs like 4869, space-separated pairs like 48 69, or 0x-prefixed tokens like 0x48 0x69.
  3. Pick lowercase (a–f) or uppercase (A–F) hex digits.
  4. Click Encode. The tool first counts isolated surrogate code units, encodes the full string to UTF-8 bytes, calculates the formatted length, and only then builds the result.
  5. Review the byte count and any replacement warning in the result panel. If the tool replaced isolated surrogate code units with U+FFFD, the warning tells you how many replacements happened, and the corresponding byte positions hold EF BF BD.
  6. Copy the complete hex string with the Copy button, or select it manually if clipboard access is blocked.

If the input is above the one-million UTF-16 code unit limit, or if the formatted output would exceed the 4,999,999 code unit ceiling, the tool rejects the encode with a clear message rather than silently slicing bytes, dropping a suffix, switching to a tighter format, or sampling content.

Reading Byte Count, Replacement Warnings, and Copying

The result panel shows three pieces of information that beginners should know how to read.

  • UTF-8 byte count is the exact number of bytes the encoder produced. Divide the length of the continuous hex string by two and you should get the same number.
  • Isolated surrogate replacements is non-zero only when the input contained an unpaired high or low surrogate. JavaScript strings are UTF-16, so a surrogate pair (two code units together) is normal and produces a four-byte supplementary character; an orphan code unit is replaced with U+FFFD (EF BF BD) before encoding and the warning tells you exactly how many replacements happened.
  • Copy status reflects the most recent attempt. If the clipboard write is denied, the full read-only result stays in the panel so you can select it by hand.

Editing the text, switching format or case, or starting a fresh encode clears the previous output, error, byte counts, replacement warning, and copy status so old numbers cannot leak into a new encode.

Beginner Edge Cases: NUL, Whitespace, BOM, and Emoji

A handful of inputs surprise first-time users. Knowing them up front saves debugging time later.

NUL bytes. U+0000 is a normal character. It encodes to the byte 00, and it appears in your hex output as the two-character pair "00" exactly like any other byte. The tool does not treat NUL as a terminator.

Whitespace. Spaces, tabs, line feeds (LF), and carriage returns (CR) are encoded in the exact order they appear in your input. The tool does not trim, normalize newlines, or fold whitespace case.

UTF-8 BOM behavior. TextEncoder does not prepend a UTF-8 byte order mark. If your input itself starts with the character U+FEFF (the "zero-width no-break space" or BOM), the encoder treats it as data and produces the bytes EF BB BF. If you need an exact round trip through the companion Hex to Text tool, leave U+FEFF out of the source text; that decoder is documented to consume a leading BOM rather than preserve it as a character.

Emoji and supplementary characters. Emoji such as 😀 are outside the Basic Multilingual Plane, so a well-formed input encodes them as four bytes. If you see "f09f9880" in the output, that is exactly one emoji and not three Latin letters.

Combining marks and precomposed forms. The encoder does not apply Unicode normalization. A precomposed "é" (U+00E9) becomes c3a9, while a decomposed "e" + U+0301 stays 65 cc 81. If your downstream code expects one form, supply that form in the input.

Where to Go Next

Once you can read byte counts and pick a format, you can start using the output for real work: debugging character encoding issues, hand-checking UTF-8 byte sequences in log files, or generating test vectors. A useful next step is seeing the same character ranges side by side in the Text to Hex Cheat Sheet: UTF-8 Values and Format Reference, and if you prefer to see concrete outputs for ASCII, accented characters, and emoji, walk the worked examples in Text to Hex Example: What UTF-8 Bytes Look Like in Practice.

For the formal rules behind the encoder itself, the WHATWG Encoding Standard defines the UTF-8 encoder and the TextEncoder encode method that this tool relies on, and MDN documents the same browser API surface.