AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
Convert text to hexadecimal and back. Supports uppercase/lowercase, with or without byte separators.
Hexadecimal (or hex) is a base-16 number system that uses sixteen distinct symbols: 0-9 to represent values 0-9, and A-F (or a-f) to represent values 10-15. Hex encoding converts binary data into a human-readable string of hex digits.
Each byte (8 bits) is represented by two hex digits. For example, the byte value 255 is represented as FF in hex, and the ASCII character A (decimal 65) is represented as 41.
Hex encoding uses 2 characters per byte (16×16 = 256 values), making the output twice the size of the input. Base64 uses 4 characters per 3 bytes (64×64×64×64 = 16M values), about 33% larger. Hex is more human-readable; Base64 is more space-efficient.
Yes, but this tool uses UTF-16 code units (JavaScript's native string encoding). Characters in the Basic Multilingual Plane (BMP) encode to 2 hex bytes per character. Supplementary characters (emojis, rare scripts) will encode to 4 hex bytes (2 surrogate pairs).
Yes. The decode function automatically handles hex strings with spaces, without spaces, or with 0x or \x prefixes. It strips non-hex whitespace and processes the remaining hex digits.
Non-hexadecimal characters (anything except 0-9, A-F, a-f, and whitespace) are ignored during decode. If no valid hex digits remain, the output will be empty.
A byte is 8 bits. Each hex digit represents 4 bits (0-15). So 8 bits ÷ 4 bits per hex digit = 2 hex digits per byte. The maximum value FF (hex) = 255 (decimal) = 11111111 (binary).
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026