Free Online Tool

SQL Query Converter
MySQL, PostgreSQL & SQLite

Paste any SQL query and convert it between MySQL, PostgreSQL and SQLite dialects instantly. No file upload needed — just paste, pick your dialects, and get the converted query in seconds.

No file upload needed Instant conversion Ctrl+Enter shortcut 100% free
Ctrl+Enter to convert
MySQL Input
PostgreSQL Output
What Gets Converted

Every SQL Dialect Difference, Handled Automatically

The converter knows every syntax difference between MySQL, PostgreSQL and SQLite and rewrites your query correctly every time.

MySQL → PostgreSQL
`backtick` identifiers "double-quoted" identifiers
AUTO_INCREMENT SERIAL / BIGSERIAL
TINYINT(1) BOOLEAN
DATETIME TIMESTAMP
ENGINE=InnoDB removed
DEFAULT CHARSET=utf8mb4 removed
INSERT IGNORE INTO INSERT INTO … ON CONFLICT DO NOTHING
IFNULL(a, b) COALESCE(a, b)
GROUP_CONCAT(x) STRING_AGG(x, ',')
INTERVAL 7 DAY INTERVAL '7 days'
MySQL → SQLite
`backtick` identifiers "double-quoted" identifiers
INT AUTO_INCREMENT PK INTEGER PRIMARY KEY AUTOINCREMENT
VARCHAR(n) TEXT
DATETIME / TIMESTAMP TEXT (ISO 8601)
TINYINT(1) INTEGER
ENGINE=InnoDB removed
UNSIGNED removed
BOOLEAN INTEGER
PostgreSQL → MySQL
"double-quoted" identifiers `backtick` identifiers
SERIAL INT AUTO_INCREMENT
BIGSERIAL BIGINT AUTO_INCREMENT
BOOLEAN TINYINT(1)
TIMESTAMP DATETIME
BYTEA BLOB
DOUBLE PRECISION DOUBLE
ON CONFLICT DO NOTHING INSERT IGNORE INTO
INTERVAL '7 days' INTERVAL 7 DAY
STRING_AGG(x, sep) GROUP_CONCAT(x SEPARATOR sep)
About This Tool

Convert SQL Queries Between Dialects Without Uploading a File

SQL dialects look similar but differ in enough ways to break a query when you move between database engines. A SELECT that runs perfectly on MySQL will often fail on PostgreSQL because of identifier quoting, function names or type handling. The same query on SQLite might fail for different reasons entirely.

This tool converts individual SQL queries — SELECT, INSERT, UPDATE, CREATE TABLE, and more — between MySQL, PostgreSQL and SQLite without requiring you to upload a file. Paste your query, pick the source and target dialect, and get the converted version in seconds.

Common use cases

  • Converting a MySQL query to run on PostgreSQL during a database migration
  • Translating a PostgreSQL query to SQLite for local development or testing
  • Checking how a query will look in a different dialect before migrating a full database
  • Learning the syntax differences between MySQL, PostgreSQL and SQLite
  • Fixing a query that fails after switching database engines
Need to convert a full database file? Use the DB File Converter to upload and convert entire SQL dumps, SQLite files, CSV spreadsheets and JSON data.
MySQL → PostgreSQL
-- Input (MySQL)
SELECT `u`.`id`, `u`.`name`
FROM `users` AS `u`
WHERE `u`.`active` = 1
AND `u`.`created_at` > NOW() - INTERVAL 7 DAY;
-- Output (PostgreSQL)
SELECT "u"."id", "u"."name"
FROM "users" AS "u"
WHERE "u"."active" = 1
AND "u"."created_at" > NOW() - INTERVAL '7 days';
Supported Queries

Works With All SQL Statement Types

The converter handles DDL, DML and DQL statements — not just SELECT queries.

🔍
SELECT
Read queries with JOINs, subqueries, window functions and aggregates
INSERT
INSERT INTO with VALUES, INSERT IGNORE and ON CONFLICT handling
✏️
UPDATE
UPDATE with SET, WHERE and JOIN syntax differences
🗑️
DELETE
DELETE FROM with WHERE conditions and subqueries
🏗️
CREATE TABLE
Full schema conversion including types, constraints and indexes
🔧
ALTER TABLE
Column additions, modifications and constraint changes
📑
CREATE INDEX
Index creation syntax across all three dialects
🔄
Transactions
BEGIN, COMMIT, ROLLBACK and SAVEPOINT statements
FAQ

Common Questions

Just queries. Paste a single SQL statement or a small block of SQL and get the converted version. To convert entire database files — SQL dumps, SQLite files, CSV spreadsheets — use the DB File Converter tool.

MySQL and MariaDB, PostgreSQL, and SQLite. You can convert in any direction between these three.

Yes. The converter handles SELECT with JOINs, subqueries, window functions, GROUP BY, HAVING, and most common SQL constructs. Very complex or database-specific functions may need manual review.

IFNULL(a, b) is converted to COALESCE(a, b) for PostgreSQL and SQLite. GROUP_CONCAT is converted to STRING_AGG for PostgreSQL. Common function differences are handled automatically.

Yes. CREATE TABLE statements are fully supported, including data type conversion, AUTO_INCREMENT to SERIAL, backtick to double-quote identifiers, and removal of MySQL-specific ENGINE and CHARSET declarations.

No hard limit. The converter works in your browser and handles queries of any length. Very large blocks of SQL may take a moment to process.

Ready to Convert Your SQL Query?

Paste your query in the editor above and get the converted version in seconds. No account, no cost.

Start Converting Convert a Full Database File