FORMATFYCOM formátovač · validátor · minifikátor About

What's new

SQL Formatter

Format SQL queries for MySQL, PostgreSQL, SQL Server, Oracle and SQLite, with a warning for UPDATE or DELETE without WHERE. Free.

Input

Output


      

How to format and check SQL

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.

  1. Paste your SQL

    A query from a log, an ORM or a console — several statements separated by semicolons are fine.

  2. Pick a dialect and style

    Uppercase keywords, indentation and the “AND / OR inline” option for compact conditions.

  3. Review the warnings

    A yellow bar above the result lists risky and suspicious constructs, some with a one-click fix.

What the SQL formatter warns about

It doesn’t only look at syntax — mainly at logical mistakes the database will happily execute, and then it’s too late.

UPDATE / DELETE without WHERE

Changes or deletes every row of the table.

DELETE FROM orders;→DELETE FROM orders WHERE id = 42;

ORDER BY and LIMIT in UPDATE

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;

Comparing with NULL

“= NULL” is never true; compare with IS NULL.

WHERE state = NULL→WHERE state IS NULL
✓ fixed automatically

NOT IN with a subquery

If 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 and OR without parentheses

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 = 3

JOIN without a condition

JOIN without ON, or comma-joined tables without WHERE = Cartesian product.

FROM orders JOIN customers→… JOIN customers ON customers.id = orders.customer_id

LIKE without wildcards

LIKE 'abc' works like “=” — either a % is missing or use “=”.

WHERE name LIKE 'Jane'→WHERE name LIKE 'Jane%'
✓ fixed automatically

Functions on columns in WHERE

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.

FAQ

Does it check syntax too?

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.

What does “AND / OR inline” do?

Conditions joined by AND/OR stay on one line and short parentheses collapse — handy for long WHERE clauses. Subqueries stay expanded.

Which dialects are supported?

MySQL, MariaDB, PostgreSQL, SQLite, SQL Server (T-SQL), Oracle (PL/SQL), BigQuery and standard SQL.

Is it free, without sign-up?

Yes. No sign-up, no ads and no size limit — the only limit is your computer.

Is my data sent to a server?

No. Everything runs in your browser and the data you paste never leaves it — fine even for data with tokens or personal information.

Related tools