CONVERT() in MySQL — How It Works
What the MySQL CONVERT() function does, with an example.
Published October 22, 2026
CONVERT(expr, type) converts a value's type; CONVERT(expr USING charset) converts character sets.
How it works
It overlaps with CAST for types and is the only way to change charset inline.
Try it in MySQL
SELECT CONVERT('42', SIGNED)
42
SELECT CONVERT('é' USING ascii)
?
SELECT CONVERT(price, CHAR) FROM products LIMIT 1
'9.99'
Practical examples
Example 1
SELECT CONVERT('42', SIGNED);
-- 42Example 2
SELECT CONVERT('é' USING ascii);
-- ?Example 3
SELECT CONVERT(price, CHAR) FROM products LIMIT 1;
-- '9.99'Use it in a real query
SELECT id, CONVERT('42', SIGNED) AS result
FROM your_table
LIMIT 10;Common mistakes
- Charset conversion losing characters.
- Using on indexed columns in WHERE.
- Confusing with CAST.
Key takeaways
- CONVERT() in one line: CONVERT(expr, type) converts a value's type; CONVERT(expr USING charset) converts character sets.
- Try queries in a test database first.
- Check NULL handling and data types.
FAQ
When use USING?
To convert between character sets.
Does CONVERT() work in other databases?
Most have an equivalent, but names and syntax vary between MySQL, PostgreSQL, SQL Server and SQLite.