b2KIT

Hex Encoder / Decoder

Convert text to hexadecimal and back. Supports ASCII, UTF-8, and raw binary hex with delimiter options.

Tested tool guide Tested browser tools Checked August 16, 2026

What Hex Encoder / Decoder does, with a checked example

Hex Encoder / Decoder translates characters into byte values written in hexadecimal, or reads hexadecimal byte pairs and converts them back to text. Choose ASCII for ASCII characters, UTF-8 for Unicode text, or raw binary hex when the bytes need not represent readable characters. Delimiter options let you join byte pairs or separate them for inspection and copying. The common surprise is that hex is not itself a character encoding. Text must first become bytes, and one visible UTF-8 character can occupy several byte pairs.

Worked example

A concrete input and expected output from the current implementation.

Input

Text: Hi
Operation: encode
Mode: UTF-8
Delimiter: none

Expected output

4869

H is U+0048 and becomes UTF-8 byte 0x48; i is U+0069 and becomes byte 0x69. With no delimiter, the two byte pairs concatenate as 4869.

How the result is produced

1

Encoding text bytes

During encoding, UTF-8 mode converts each character to its UTF-8 byte sequence, while ASCII mode represents characters from the ASCII repertoire with their ASCII byte values. Each byte is then written as two hexadecimal digits, from 00 through FF. A selected delimiter changes the visible boundary between byte pairs, not the byte values themselves.

2

Decoding hex pairs

During decoding, every two hexadecimal digits describe one byte: 48 is decimal 72, and 69 is decimal 105. The chosen text mode determines how the recovered bytes are interpreted as characters. Raw binary hex is appropriate when the sequence should remain byte-oriented rather than being treated as readable text. A trailing single hex digit cannot describe a complete byte.

Good uses

  • Turn a short UTF-8 string into exact byte pairs for a protocol example, software test vector, or binary payload fixture.
  • Decode hexadecimal copied from a log or packet field to check whether its bytes represent readable ASCII or UTF-8 text.
  • Reformat byte values with spaces or another available delimiter before placing them in debugging notes or byte-oriented documentation.

Limits and checks

  • A hexadecimal sequence does not identify its original character encoding. Record whether its bytes should be interpreted as ASCII, UTF-8, or raw binary.
  • Count hexadecimal digits after excluding configured delimiters. An odd count leaves one unmatched nibble, which is insufficient to represent a complete byte.
  • Hexadecimal is reversible notation, not encryption. Anyone who receives the displayed hex can recover the original bytes without a secret key.

Common questions

Can the decoder determine whether my hex is ASCII or UTF-8?

No. Hexadecimal text records byte values but carries no label declaring ASCII, UTF-8, or arbitrary binary. ASCII bytes are also valid UTF-8 bytes, so those modes agree for ordinary ASCII. For bytes above 7F, the selected interpretation matters, and some byte sequences do not form valid UTF-8 text.

Is hexadecimal output encrypted?

No. Hex encoding is reversible formatting, not confidentiality or integrity protection. Anyone who has the hex can decode the same bytes, and changing a digit changes the represented data without providing a trustworthy tamper signal. Use an appropriate cryptographic mechanism when secrecy, authentication, or tamper detection is the actual requirement.

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