Text to hex converter

Text to hexadecimal bytes (UTF-8) and hex back to text, with each byte split into two nibbles.

How it works

Hexadecimal is base 16, with the digits 0 to 9 and A to F (10 to 15). One hex digit holds exactly 4 bits, so one byte, 8 bits, is always two hex digits: from 00 to FF. That is why hex is the standard way to write bytes, keys and hashes.

To convert text, it is first encoded as bytes (here in UTF-8), then every byte is split into its high and low 4 bits, and each half becomes one digit. For H, code 72 = 0100 1000 in binary, the halves are 4 and 8: H is 48 in hex. Going back, every pair of digits is $16 \cdot \text{first} + \text{second}$.

RFC 4648 calls this encoding Base16. It doubles the size of the data, but it is the easiest to read and to compare by eye.

Everything is calculated in your browser. Nothing you type leaves your device.