utilstuff.com
Back to Dev Tools

HEX / Base16 Encoder & Decoder

Convert UTF-8 text to hexadecimal (Base16) bytes and decode hex strings back to text. 100% client-side, fast, private, and secure.

100% Client-Side Hex Encoding & Decoding
HEX / Base16 is a binary data representation format, not encryption. All text-to-hex and hex-to-text transformations execute entirely in your browser. No data is stored, logged, or sent to external servers.
Loadable Standard Test Vectors
ASCII Text
Standard ASCII string (48656c6c6f...)
Spanish/French Accents
UTF-8 multibyte accented characters
CJK Multibyte
Chinese 3-byte UTF-8 sequences
Emoji Sequence
4-byte UTF-8 surrogate pair symbols
Raw Binary Hex
Raw hexadecimal byte stream decoding
What is Hexadecimal (Base16) Encoding?

Hexadecimal (HEX or Base16) is a positional numeral system with a radix of 16. It uses sixteen distinct symbols: 0–9 and A–F (or a–f). Each hexadecimal digit represents four bits (1 nibble), and two hexadecimal digits represent one 8-bit byte (0x00 to 0xFF).

HEX Byte Mapping Reference

Character / SymbolHex Byte (0x)Decimal ValueBinary Byte (8-bit)
ASCII 'A'416501000001
ASCII 'Hello'48 65 6c 6c 6f72, 101, 108, 108, 1115 Bytes
UTF-8 Accent 'é'c3 a9195, 1692 Multibyte Bytes
CJK '你'e4 bd a0228, 189, 1603 Multibyte Bytes

HEX (Base16) vs Base64 Comparison

Feature / MetricHEX / Base16Base64
Alphabet Size16 chars (0-9, a-f)64 chars (A-Z, a-z, 0-9, +, /)
Storage Efficiency2 chars per byte (100% expansion)4 chars per 3 bytes (~33% expansion)
Use CasesHashes, Crypto Keys, Memory Dumps, MicrocontrollersEmail Attachments, Web APIs, Data URLs, JWTs

What Is Hexadecimal Encoding?

Hexadecimal (base16) represents each byte of data as two hex digits (00–FF), giving a compact, human-readable way to inspect raw bytes — common in networking, low-level debugging, and binary file formats.

How to Use the HEX Encoder / Decoder

  1. Paste text to convert it to hexadecimal, or paste a hex string to decode it back to text.
  2. Choose Encode or Decode.
  3. Review the byte count and result.
  4. Copy the output.

Technical Notes

  • Each byte becomes exactly two hex characters, so a hex string's length is always even.
  • Text is encoded as UTF-8 bytes first, so multi-byte characters (accents, emoji, non-Latin scripts) produce more than two hex digits per visible character.
  • Hex is a representation, not a cipher — it carries no security on its own.

Example

Text to Hex
Hi!→48 69 21

Frequently Asked Questions

Is HEX encoding uppercase or lowercase?+

Standard hexadecimal output in this tool uses lowercase letters (e.g. 48656c6c6f). However, when decoding, both uppercase (48656C6C6F) and lowercase inputs are accepted and decoded identically.

Why was my odd-length HEX input rejected?+

Each byte (8 bits) requires exactly two hexadecimal digits (4 bits per digit). An odd-length hexadecimal string (like "ABC") is incomplete and ambiguous, so strict validation rejects it to prevent silent data corruption.