Paste a query, a CREATE TABLE statement or a whole script and translate it from one SQL dialect to another: MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery, Snowflake, Redshift, DuckDB, Spark, Presto/Trino, ClickHouse and more. Features with no equivalent in the target database are listed so you know exactly what to fix by hand.
Last updated:
Quick rules preview
Your SQL never leaves the browser. Convert SQL loads the open-source sqlglot transpiler (Python, run locally with Pyodide, about 12 MB once, then cached); quick rules work instantly without it.
Advertisement
Advertisement
How to use the SQL Dialect Converter
Choose the source and target dialects, for example MySQL to PostgreSQL. The swap button reverses them.
Paste your SQL or open a .sql file. A quick-rules translation appears immediately.
Press Convert SQL to load the full sqlglot engine (once, about 12 MB) for a complete parse and a formatted result.
Read the Unsupported and Notes lists under the panes and adjust anything the target database cannot express.
Copy or download the converted SQL and test it on your database.
Common differences between SQL dialects
Task
MySQL
PostgreSQL
SQL Server
Oracle
SQLite
Quote an identifier
`name`
"name"
[name]
"NAME"
"name"
First 10 rows
LIMIT 10
LIMIT 10
SELECT TOP 10
FETCH FIRST 10 ROWS ONLY
LIMIT 10
Current date and time
NOW()
NOW()
GETDATE()
SYSTIMESTAMP
CURRENT_TIMESTAMP
Null fallback
IFNULL(a, b)
COALESCE(a, b)
ISNULL(a, b)
NVL(a, b)
IFNULL(a, b)
String length
CHAR_LENGTH(s)
LENGTH(s)
LEN(s)
LENGTH(s)
LENGTH(s)
Join strings
CONCAT(a, b)
a || b
a + b
a || b
a || b
Aggregate strings
GROUP_CONCAT(x)
STRING_AGG(x, ',')
STRING_AGG(x, ',')
LISTAGG(x, ',')
GROUP_CONCAT(x)
Auto-increment key
AUTO_INCREMENT
GENERATED … AS IDENTITY
IDENTITY(1,1)
GENERATED … AS IDENTITY
INTEGER PRIMARY KEY
Boolean column
TINYINT(1) / BOOLEAN
BOOLEAN
BIT
NUMBER(1)
INTEGER
Upsert
ON DUPLICATE KEY UPDATE
ON CONFLICT … DO UPDATE
MERGE
MERGE
ON CONFLICT … DO UPDATE
Tips for a smooth migration
Convert the schema first. Translate CREATE TABLE statements, create the tables, then convert the queries that use them, so type errors surface early.
Watch implicit behavior. MySQL compares strings case-insensitively by default while PostgreSQL does not; empty strings are NULL in Oracle; integer division truncates in PostgreSQL and SQL Server.
Quote consistently. PostgreSQL folds unquoted names to lower case and Oracle to upper case, so a name created in quotes must always be quoted. The Quote all identifiers option keeps the original case.
Test paging and dates. OFFSET/FETCH needs ORDER BY in SQL Server, and date functions rarely map one-to-one.
Convert SQL runs sqlglot, an open-source Python library that parses SQL into a syntax tree and writes it back out in another dialect. It runs inside your browser through Pyodide, so your queries are never uploaded. Before that engine loads, a built-in set of quick rules handles the most common differences instantly.
Can it convert MySQL to PostgreSQL?
Yes. Typical changes include backtick identifiers to double quotes, AUTO_INCREMENT to GENERATED BY DEFAULT AS IDENTITY, DATETIME to TIMESTAMP, TINYINT(1) to BOOLEAN, IFNULL to COALESCE, LIMIT offset, count to LIMIT … OFFSET, and removing ENGINE and CHARSET table options. ON DUPLICATE KEY UPDATE is flagged so you can rewrite it as ON CONFLICT.
How is LIMIT converted for SQL Server and Oracle?
SQL Server uses SELECT TOP n for a simple limit and OFFSET m ROWS FETCH NEXT n ROWS ONLY for paging, which requires an ORDER BY clause. Oracle 12c and later use OFFSET … FETCH FIRST n ROWS ONLY; older versions need ROWNUM.
What does "unsupported" mean in the results?
It marks a feature the target database cannot express directly, for example RETURNING in MySQL, FULL OUTER JOIN in MySQL, or MySQL's ON UPDATE CURRENT_TIMESTAMP elsewhere. The converter keeps the closest output it can and lists these so you can rewrite them by hand.
Will stored procedures and triggers convert?
Procedural code (PL/SQL, T-SQL batches with variables and control flow, PL/pgSQL functions) differs too much between databases for automatic translation. The converter is built for queries, DML and DDL such as CREATE TABLE, CREATE VIEW and INSERT.
Is my SQL sent to a server?
No. The page itself does the conversion. The only network use is downloading the Pyodide runtime and the sqlglot package from public CDNs the first time you press Convert SQL; your SQL text stays in the browser.
Why do date functions need review?
Date arithmetic and formatting are among the least standardized parts of SQL: DATEADD, DATE_ADD, INTERVAL arithmetic, DATE_FORMAT, TO_CHAR and strftime all take different arguments. sqlglot converts many of them, but always test date logic and time zones on the target database.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.