HEX
Return the hexadecimal representation. This function converts a number or string to its hexadecimal string equivalent.
Syntax
HEX(N_or_S)Description
Examples
SELECT HEX(255);
+----------+
| HEX(255) |
+----------+
| FF |
+----------+
SELECT 0x4D617269614442;
+------------------+
| 0x4D617269614442 |
+------------------+
| MariaDB |
+------------------+
SELECT HEX('MariaDB');
+----------------+
| HEX('MariaDB') |
+----------------+
| 4D617269614442 |
+----------------+See Also
Last updated
Was this helpful?

