Format SQL queries for MySQL, PostgreSQL, SQL Server, Oracle and SQLite, with a warning for UPDATE or DELETE without WHERE. Free.
The SQL formatter neatly indents queries for MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, Oracle and BigQuery and warns about common mistakes — from UPDATE without WHERE to comparing with NULL. If a query fails in the selected dialect, it tries the others.
A query from a log, an ORM or a console — several statements separated by semicolons are fine.
Uppercase keywords, indentation and the “AND / OR inline” option for compact conditions.
A yellow bar above the result lists risky and suspicious constructs, some with a one-click fix.
It doesn’t only look at syntax — mainly at logical mistakes the database will happily execute, and then it’s too late.
Changes or deletes every row of the table.
DELETE FROM orders;→DELETE FROM orders WHERE id = 42;No effect without LIMIT in MySQL; a syntax error in PostgreSQL, SQL Server and Oracle.
UPDATE t SET s = 1 ORDER BY id;→UPDATE t SET s = 1 WHERE … ORDER BY id LIMIT 1;“= NULL” is never true; compare with IS NULL.
WHERE state = NULL→WHERE state IS NULLIf the subquery returns a single NULL, nothing matches. NOT EXISTS is safer.
WHERE id NOT IN (SELECT x FROM u)→WHERE NOT EXISTS (SELECT 1 FROM u WHERE u.x = t.id)AND binds first — “a OR b AND c” means “a OR (b AND c)”. The warning shows the line and spot.
WHERE a = 1 OR b = 2 AND c = 3→WHERE (a = 1 OR b = 2) AND c = 3JOIN without ON, or comma-joined tables without WHERE = Cartesian product.
FROM orders JOIN customers→… JOIN customers ON customers.id = orders.customer_idLIKE 'abc' works like “=” — either a % is missing or use “=”.
WHERE name LIKE 'Jane'→WHERE name LIKE 'Jane%'YEAR(date) or LIKE '%…' prevent index use — compare a range instead.
WHERE YEAR(created) = 2026→WHERE created >= '2026-01-01' AND created < '2027-01-01'…and more: HAVING without an aggregate, SELECT * with GROUP BY, INSERT without a column list, “OR 1=1”, empty IN (), SET a = a, a comma before FROM.
The query is parsed for the selected dialect; if that fails, the formatter tries the others and tells you which one worked. Tables and columns (the schema) are not checked.
Conditions joined by AND/OR stay on one line and short parentheses collapse — handy for long WHERE clauses. Subqueries stay expanded.
MySQL, MariaDB, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle (PL/SQL), BigQuery and standard SQL.
Yes. No sign-up, no ads and no size limit — the only limit is your computer.
No. Everything runs in your browser and the data you paste never leaves it — fine even for data with tokens or personal information.