MySQLString FunctionsHEX
CHAR

HEXString Functions

SPACE

Converts a string or number to a hexadecimal string.

Syntax

HEX(str | n)

Example

Enter values below to update the example in real time.

product_id
hex_id
products
SELECT product_id, HEX(product_id) AS hex_id
FROM products;