Hex Encoding & Decoding
Convert UTF-8 text to or from hexadecimal notation locally in your browser.
Hex Decoding
Convert Hex text back to UTF-8 text.
- Paste encoded text
- Decode bytes
- Copy text
Hex Encoding
Convert UTF-8 text to Hex text.
Hexadecimal encoding and decoding guide
Learn how hexadecimal represents bytes, why it appears in cryptography, and how it differs from encryption.
Hexadecimal, often shortened to hex, is a base-16 notation that represents each byte with two characters from 0–9 and A–F. Developers use it to display binary values such as hashes, keys, identifiers, and ciphertext because it is predictable and easy to inspect. Hex is an encoding, not encryption: it provides no secrecy and can be converted back to the original bytes by anyone who has the string.
When encoding text in this workspace, each UTF-8 byte is converted into a pair of hexadecimal digits. Decoding reverses that representation back to text. The input must contain valid pairs of hexadecimal characters; a missing digit or a pasted prefix such as 0x can make another system reject the value. Uppercase and lowercase hex normally represent the same byte, but surrounding whitespace and the intended character encoding can still affect compatibility.
Hex is especially common in cryptographic documentation because binary output cannot always be copied safely. For example, a SHA-256 digest is often displayed as 64 hex characters, while an AES ciphertext might be transported as either hex or Base64. Always record which representation a system expects. If you need confidentiality, encrypt the original bytes before converting them to hex; if you need authenticity, use an HMAC or digital signature. A readable hex string is still data that deserves appropriate handling.
A careful workflow
- Use two hexadecimal characters for every byte of input.
- Remove prefixes, separators, and whitespace unless the receiving system explicitly permits them.
- Document whether a value is raw text, Hex, or Base64 before passing it to a cryptographic tool.
FAQ
Is hexadecimal encrypted?
No. Hex is a reversible display format for bytes.
Why must hex have an even number of characters?
Each byte is represented by two hexadecimal digits.
Should I use Hex or Base64?
Hex is easy to inspect but larger; Base64 is more compact for transport. Use the format required by the receiving system.
Further reading: RFC 4648: Base-N encodings