ETEvoraTools
Encoding & Decoding

Text to Hex

Text to Hex converts the entered JavaScript string to UTF-8 bytes with TextEncoder and prints two lowercase hex digits per byte without spaces, prefixes, or line wrapping. Non-ASCII characters therefore produce multiple byte pairs. Hex is reversible representation and doubles the byte length in ASCII characters; it offers no encryption, compression, or integrity check.

Runs locally — files stay on your device
Quick answer

Why can one character produce several hex pairs?

Unicode text is first encoded as UTF-8, where many characters use multiple bytes.

Hex represents each byte independently

One byte becomes exactly two digits from 0–9 and a–f. Text encoding determines which bytes represent the original characters.

How it works

TextEncoder creates UTF-8 bytes and each byte is padded to two hexadecimal digits before concatenation.

Key concepts

Bytes, not code points

ă becomes c483 in UTF-8.

Continuous lowercase output

Formatting conventions must be added separately.

When to use it

  • Inspect UTF-8 byte values.
  • Prepare text for a protocol expecting unseparated hex.
  • Compare exact text encodings during debugging.

When not to use it

  • Do not use hex for confidentiality.
  • Do not expect Unicode code points rather than UTF-8 bytes.
  • Do not expect a 0x prefix or separators.

Worked examples

ASCII

Input
A
Expected output
41

ASCII agrees with UTF-8 for this byte.

Romanian letter

Input
ă
Expected output
c483

Two UTF-8 bytes are required.

Empty text

Input
(empty input)
Expected output
Empty result

There are no bytes.

Common mistakes

Expecting UTF-16 units

TextEncoder emits UTF-8. Correction: Use the destination's stated encoding.

Adding 0x per value mentally

Output is one continuous string. Correction: Split into pairs when reading.

Calling it a hash

Hex can be decoded exactly. Correction: Use a digest generator for a fixed-length fingerprint.

Best practices

  • State UTF-8 alongside the value.
  • Preserve even-length byte pairs.
  • Use Hex to Text for a round-trip check.

Related operations and differences

Base64 Encoder

Choose Base64 Encoder when you need to encode text as Base64 in your browser.; use Text to Hex specifically for hex encode.

Hex to Text

Choose Hex to Text when you need to decode hexadecimal bytes into text.; use Text to Hex specifically for hex encode.

Text to Binary

Choose Text to Binary when you need to encode text as 8-bit binary groups.; use Text to Hex specifically for hex encode.

Base64 Decoder

Choose Base64 Decoder when you need to decode Base64 into readable text.; use Text to Hex specifically for hex encode.

Binary to Text

Choose Binary to Text when you need to decode 8-bit binary groups into text.; use Text to Hex specifically for hex encode.

ROT13 Encoder

Choose ROT13 Encoder when you need to apply the reversible ROT13 substitution.; use Text to Hex specifically for hex encode.

Limitations and privacy

  • UTF-8 only; no separators, prefix, uppercase option, alternate charset, download, compression, encryption, or checksum.

The entered value is transformed locally in this browser and is not sent to the Toolbox server.

Copying or pasting sensitive output into another service is a separate disclosure decision.

Frequently asked questions

Is output lowercase?

Yes.

Is it reversible?

Yes, with the same UTF-8 interpretation.

Does one character always equal one byte?

No.

Are spaces added?

No.

References