Skip to content
100% local

SQL dialect converter

Rewrite SQL between PostgreSQL, MySQL, SQLite and SQL Server syntax.

Input
Output

SQL dialect converter

Paste a query written for one database and get it back rewritten for another. The converter covers row-limiting syntax, common date and string functions, string concatenation, identifier quoting and column types across PostgreSQL, MySQL, SQLite and SQL Server — useful when migrating a project from MySQL to PostgreSQL, porting a script written for SQL Server to SQLite, or just checking how a query would look in another engine.

Source dialect and target dialect pick the two ends of the conversion. The checkboxes below turn individual conversions on and off: normalize identifier quoting swaps double quotes, backticks and square brackets for the target's own style; convert row limit clause switches between LIMIT, TOP and OFFSET…FETCH FIRST without ever silently dropping an offset; convert date and string functions rewrites NOW()/GETDATE()/datetime('now'), LENGTH()/LEN(), SUBSTRING()/SUBSTR() and COALESCE()/IFNULL()/ISNULL(); convert string concatenation switches between || and CONCAT()/+; convert column types maps SERIAL, AUTO_INCREMENT, IDENTITY(1,1), BOOLEAN, TEXT and TIMESTAMP-style declarations to their nearest equivalent. Keep comments controls whether -- and /* */ comments survive the rewrite.

Some constructs genuinely have no equivalent — PostgreSQL's RETURNING and ON CONFLICT, or MySQL's ON DUPLICATE KEY UPDATE — and rather than guess at a rewrite, the tool leaves them in place and lists them in a warnings block appended to the output. It rewrites statement text rather than parsing a full execution plan, so review the result before running it against a real database, especially for nested subqueries or unusual formatting. Multi-statement scripts work too: each statement separated by a semicolon converts on its own.

Everything runs locally in your browser: no query, table name, column name or connection string is ever sent anywhere. Copy the result, download it as a .txt file, or send the output straight back into the input to run another pass.

FAQ

Does it actually parse the SQL, or just do text replacement?
It rewrites known patterns — row-limit clauses, common functions, concatenation, identifier quoting and column types — with targeted text substitutions rather than a full SQL parser, so always check the result before running it against a database.
What happens to constructs that don't exist in the target dialect?
They're left in place and listed in a warnings block appended to the output, such as PostgreSQL's ON CONFLICT when converting to SQL Server.
Can I convert multi-statement scripts?
Yes — each statement, separated by semicolons, is handled on its own, so a script with several CREATE TABLE or SELECT statements converts in one pass.
Is my SQL uploaded anywhere?
No. The conversion runs entirely in your browser — your queries, schema and data never leave your device.