No—the continuous, space-separated, and 0x-prefixed formats change only the presentation of the same UTF-8 bytes, not the bytes themselves.

Text To HEX performs two distinct operations. First, it converts the entered text into a UTF-8 byte array. Second, it displays each byte as a two-digit hexadecimal value, optionally adding spaces or a 0x marker. Those separators and markers are formatting syntax around the encoded bytes; they do not replace, reorder, or transform the underlying data. The formatted output can be longer or shorter, however, because its spaces and prefixes count toward the output limit.

do the three output formats change the bytes when using text to hex utf8
Do Text-to-Hex Output Formats Change UTF-8 Bytes?

What changes between the three formats

For a successful, non-empty encode, let n represent the number of UTF-8 bytes produced from the input. The output formats use that same byte count in three different layouts:

Output format Structure Output length Practical use
Plain Two hexadecimal digits per byte, concatenated with no separators 2n characters Compact output for systems that expect a continuous hexadecimal byte stream
Spaced Two hexadecimal digits per byte, with one ASCII space between byte pairs 3n−1 characters Reviewing byte boundaries and checking individual values more easily
0x-prefixed One 0xNN token per byte, with one ASCII space between tokens 5n−1 characters Displaying explicit byte tokens in code, markup, or technical documentation

The spaced and prefixed formats put no delimiter before the first token or after the last one. The lowercase or uppercase control affects only the hexadecimal letters a–f. It does not affect byte values, and it does not turn the prefix into uppercase: the marker remains 0x.

Changing the output format can therefore change the number of characters you copy, but it cannot change the UTF-8 byte count reported by the tool. In the Text To HEX workflow, changing the format or letter case clears the previous result, so run the encoder again to generate output using the new settings.

How UTF-8 determines the byte count

The format is chosen after UTF-8 encoding, so the character-to-byte rules determine n. A browser text field normally exposes JavaScript strings, which are based on UTF-16 code units. Text To HEX uses the browser’s TextEncoder API to perform the standardized UTF-8 conversion. The WHATWG TextEncoder specification defines that conversion and its handling of Unicode scalar values.

Character category UTF-8 bytes per character Important distinction
ASCII character 1 byte Each character maps to one byte
Many common Latin characters 2 bytes The exact count depends on the Unicode code point
Most characters in the Basic Multilingual Plane 3 bytes Being a visually wide character does not determine the byte count
Supplementary Unicode scalar 4 bytes A valid surrogate pair represents one such scalar

A single worked example shows why all three layouts contain the same data. For the ASCII text Hi, UTF-8 produces two bytes, 48 and 69. The plain result is 4869, the spaced result is 48 69, and the prefixed result is 0x48 0x69. Their lengths follow the stated formulas: plain is 2n = 2×2 = 4 characters, spaced is 3n−1 = 3×2−1 = 5 characters, and prefixed is 5n−1 = 5×2−1 = 9 characters. The underlying two-byte array is identical in all three cases.

Text To HEX does not normalize Unicode, rewrite line endings, trim whitespace, fold case, parse escapes, or apply locale-specific rules. A combining sequence remains decomposed if it was entered that way. Spaces, tabs, CR, LF, and NUL are treated as data and encoded in the order supplied; NUL does not act as a terminator. These details matter because the tool reports the UTF-8 bytes of the entered text rather than a normalized or reinterpreted version of it.

Encode the formats in Text To HEX

Use the Text To HEX encoder as follows:

  1. Enter the text. Paste or type the exact text into the browser field, including any Unicode characters, whitespace, or NUL data that the field can hold. Do not trim or manually rewrite the input unless that is part of your intended data.
  2. Choose an output format. Select plain continuous pairs, space-separated pairs, or 0x-prefixed byte tokens. All three use the same UTF-8 encoding; the selection controls only the displayed syntax.
  3. Choose the hexadecimal letter case. Lowercase and uppercase produce equivalent byte values. Uppercase mode changes only A–F, while the 0x marker remains lowercase.
  4. Run the encoder. Activate the encode action. The complete result includes the UTF-8 byte count, the formatted output length, and any isolated-surrogate replacement count.
  5. Review warnings before copying. Check the byte and replacement counts, especially if the source came from damaged text, an unusual application, or a system that may contain unpaired UTF-16 surrogates.
  6. Copy the complete output. Use the copy control when available. If clipboard permission is denied, the complete read-only result remains available for manual selection.

Encoding, sizing, formatting, display, and clipboard preparation run locally in the current browser tab. The input and output are not uploaded to Lizely. Hexadecimal output is an encoding display, not encryption, hashing, compression, or a method for protecting secrets; anyone with the bytes and UTF-8 rules can recover well-formed text.

Limits that can stop an encode

The input budget is based on UTF-16 code units because browser strings use UTF-16 internally. Text To HEX accepts at most 1,000,000 input UTF-16 code units. Empty input is rejected, and input one code unit above the limit is rejected with an explicit message. A supplementary Unicode scalar uses two UTF-16 code units in the input even though its UTF-8 representation uses four bytes.

The output has a separate budget of 4,999,999 UTF-16 code units. The exact boundary is accepted, while one output code unit over the limit is rejected. Because every format character is ASCII, the displayed character count and UTF-16 code-unit count are the same for the formatted result.

The selected format affects how quickly that output budget is reached. For a given byte count, plain is the most compact, spaced adds one space between byte pairs, and the prefixed form adds more characters per byte. Multi-byte Unicode also increases the number of UTF-8 bytes relative to the number of visible characters. As a result, a verbose format can reach the output limit before the input limit is reached.

The tool calculates the full formatted size from the UTF-8 byte count and selected syntax, then checks that prediction before building the large output string. If the result exceeds the limit, it reports the failure instead of changing formats, slicing the byte array, dropping a suffix, or sampling the input. Ordinary text can still exceed the output limit in a verbose layout even when the same byte count would fit in plain format.

Round trips, BOMs, and replacement warnings

An exact text-to-hex-to-text round trip requires well-formed Unicode input. A valid high-plus-low UTF-16 surrogate pair represents one supplementary Unicode scalar and is encoded normally. An isolated high or low surrogate is different: it is not a Unicode scalar, so the standardized TextEncoder conversion replaces each isolated surrogate code unit with U+FFFD before UTF-8 encoding. The result panel shows the replacement count because decoding those bytes cannot recover the original isolated code unit.

TextEncoder does not prepend a UTF-8 byte order mark. Ordinary input therefore starts directly with the first character’s bytes. If the input itself contains U+FEFF, that character is encoded as data rather than added metadata. The companion Hex to Text Converter consumes a leading BOM under its documented decoding policy, so an exact round trip through that particular tool also requires that the original text not begin with U+FEFF. An internal U+FEFF remains part of the text.

The original input and its byte representation should also be considered separately. Hexadecimal is a reversible representation of bytes for valid UTF-8, but the workflow does not guarantee exact recovery of malformed UTF-16 data that has already been replaced. Reviewing the replacement warning before relying on a round trip prevents an irreversible substitution from being mistaken for the original character data.

Choosing a format for the next tool

Choose the format according to the consumer of the copied value. Plain output is the shortest and is suitable when the receiving parser expects one uninterrupted hexadecimal sequence. Spaced output makes individual bytes easier to inspect while remaining conventional in many debugging contexts. The 0x-prefixed format is the most explicit, but it is also the longest and should only be used where the destination accepts prefixed tokens.

Do not send prefixed output to a parser that expects only continuous hex, or continuous output to a parser that requires separators. Neither layout changes the encoded data, but a strict parser can reject syntax it does not recognize. Uppercase output offers no encoding advantage over lowercase; choose it only for readability or consistency with the destination.

When the output budget is close, plain format minimizes the number of formatting characters. When human review matters more than length, spaced format provides clear byte boundaries without adding a prefix to every token. In every case, verify the UTF-8 byte count, formatted output length, and replacement warning before copying the complete result.

If you're weighing options, Convert Text Files to UTF-8 in Your Browser covers this in detail.

If you're weighing options, Binary to Text Converter: How to Choose the Right Approach covers this in detail.