b2KIT

Text to Hex Converter

Convert text to hexadecimal encoding and decode hex strings back to human-readable text.

Tested tool guide Tested browser tools Checked August 16, 2026

What Text to Hex Converter does, with a checked example

Paste text into this page and it returns the text's bytes as hex pairs, one two-digit group per byte; paste hex pairs in and it returns the text they spell. Encoding follows UTF-8, so ASCII letters, digits, and punctuation become one byte each, while accented letters, emoji, and other non-ASCII characters expand to two, three, or four bytes - the hex output is therefore longer than the character count, which surprises most people on first use. Decoding works only when the bytes are valid UTF-8, so not every hex string produces readable text. All conversion happens locally in your browser; nothing you paste is uploaded.

Worked example

A concrete input and expected output from the current implementation.

Input

Café

Expected output

43 61 66 c3 a9

C, a, and f are ASCII characters, so each becomes a single byte: 43, 61, 66. The accented é is code point U+00E9, which UTF-8 encodes as the two bytes C3 A9. Four characters become five bytes, so the hex has ten digits.

How the result is produced

1

Encoding text to hex

Each character is resolved to its Unicode code point and encoded as UTF-8: code points below 128 (ASCII) take one byte, higher ones take two, three, or four. Every byte is then written as exactly two hex digits in the range 00 to FF, so the output is always even in length and equals twice the byte count - which is not necessarily the number of characters you typed.

2

Decoding hex to text

On the way back, the hex string is split into bytes by pairing digits two at a time (separators you included are ignored). Each pair is read as a value from 0x00 to 0xFF, and the resulting byte sequence is decoded as UTF-8. Pairs that are not valid UTF-8 - for example a lead byte such as C3 with no continuation byte - produce a decode error or a replacement character.

Good uses

  • Recovering plaintext from hex dumps in network captures, firmware logs, or device output that printed readable data as hex.
  • Preparing hex constants for embedded code, protocol fields, or checksum examples when you need the bytes of a readable string.
  • Verifying what an unfamiliar hex string you were sent actually spells before forwarding, storing, or acting on it.

Limits and checks

  • Every byte takes exactly two hex digits, so odd-length hex means a digit is missing or the copy started mid-byte. '48656c6c' decodes to 'Hell', but seven digits cannot be paired into complete bytes and the result is an error or misaligned garbage.
  • The digit count is a byte count, not a character count. 'Café' is four characters but ten hex digits, and emoji can reach eight digits per character. When comparing two encodings, compare byte counts, not character counts.
  • Not every byte sequence is valid UTF-8 text. Bytes from UTF-16 or legacy single-byte encodings, or binary data such as file signatures, decode to errors or wrong characters. Case never matters - 4a and 4A are the same byte - the bytes themselves decide.

Common questions

Does spacing between hex pairs change the result?

No. '48 65' and '4865' are the same two bytes and both decode to 'He'. Spacing and other separators are cosmetic aids between pairs; only the digits and their pairing carry meaning, and a-f versus A-F never changes a value.

I decoded some hex and got error characters instead of text. What went wrong?

The bytes are almost certainly not valid UTF-8. Common causes: the hex was encoded with UTF-16 or a legacy single-byte encoding, the string was cut mid-pair so the pairing shifted, or the bytes were never text at all, such as binary data or a file signature. Re-encode on the sending side, and confirm the digit count is even before retrying.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools