Loading section...
TO_HEX() / FROM_HEX()
Basic Concepts Hexadecimal uses 16 symbols: 0-9 represent values 0-9, and A-F represent values 10-15. Two hex digits represent one byte (values 0-255). The letter "A" has ASCII value 65, which is 41 in hexadecimal (4*16 + 1 = 65). This direct byte-to-hex mapping makes hex ideal for inspecting exactly what bytes a string contains. Encoding & Decoding Each character becomes two hex digits. "Hello" is 5 characters, producing 10 hex digits. Reading the hex, 48 is "H", 65 is "e", and so on. This visibility into the actual bytes helps debug encoding issues. Decoding Hex to Text Best Practices Hex encoding reveals hidden characters and encoding problems that are invisible in normal display: The word "Cafe" with an accented e has 4 visible characters but 5 bytes because the accented e uses 2 bytes