Encode & Decode  |  UTF-8 safe  |  Byte-level view  |  Instant

Hex Encoder / Decoder

Convert text to hexadecimal encoding and decode hex strings back to plain text. Each byte is represented as two hex digits (0–9, A–F). Useful for debugging binary data, inspecting byte values and working with low-level protocols.

1
Encode to Hex
Enter plain text and convert each character to its hexadecimal byte value

2
Decode from Hex
Paste a hex string and convert it back to plain text
Hex output auto-filled. Click Decode to convert back to plain text.

What is Hex Encoding?

Hexadecimal (hex) encoding converts binary or text data into a string of hexadecimal digits, representing each byte as exactly two characters from the set 0–9 and A–F. It is the most direct way to view the raw byte values of any data.

Note: Like Base64, hex encoding is not encryption — it is easily reversible and provides no security. It is used purely for representation.

How hex encoding works

CharacterASCII (decimal)HexBinary
H724801001000
e1016501100101
x1207801111000

So "Hex" in hex encoding is 48 65 78. Each byte always becomes exactly 2 hex characters, making the output predictable and easy to parse.

Key properties

PropertyDescription
DeterministicSame input always produces the same hex output
Fixed sizeEvery byte becomes exactly 2 hex digits — output is always 2× input size
ReversibleCan be decoded back to the original data losslessly
Character setOnly 0–9 and A–F — safe in any text-based system

Common use cases

  • Cryptography — keys, IVs, hashes and signatures are commonly displayed as hex strings
  • Debugging — hex dumps let developers inspect raw bytes in network packets and files
  • Protocols — many low-level protocols (TLS, SSH, binary formats) use hex notation
  • Colour codes — web colours like #FF5733 are hex-encoded RGB values
  • MAC / IP addresses — network addresses are shown as hex bytes

Hex vs Base64

PropertyHexBase64
Size overhead2× (100% larger)~1.33× (33% larger)
ReadabilityEasy to inspect individual bytesCompact but opaque
Character set0–9, A–F (16 chars)A–Z, a–z, 0–9, +, / (64 chars)
Best forDebugging, byte inspectionTransport efficiency, JWT, email

References

  1. Hexadecimal on Wikipedia
  2. MDN — Number.toString(16) for hex conversion