SQL Formatter

Beautify SQL queries with proper indentation and uppercase keywords.

Examples

InputResult
select id,name from users where active=1SELECT id, name FROM users WHERE active = 1
INSERT INTO orders(id,total) VALUES(1,99.99)INSERT INTO orders (id, total) VALUES (1, 99.99)
select * from a join b on a.id=b.a_id where a.x>5SELECT * FROM a JOIN b ON a.id = b.a_id WHERE a.x > 5
select count(*) as cnt, type from items group by type having cnt>10 order by cnt descSELECT count(*) AS cnt, type FROM items GROUP BY type HAVING cnt > 10 ORDER BY cnt DESC

About this tool

Paste a SQL query and get a properly indented version with uppercase keywords, aligned clauses, and consistent spacing. This makes long queries with multiple joins and subqueries much easier to read and review.

The formatter works with standard SQL syntax and handles common statement types including SELECT, INSERT, UPDATE, and DELETE. It processes everything in your browser, so you can safely format queries that contain production data references.

Frequently asked questions

Which SQL dialects are supported?

The formatter handles standard SQL syntax that works across MySQL, PostgreSQL, SQLite, and SQL Server. Dialect-specific extensions may vary in formatting quality.

Does the formatter change the meaning of my query?

No. It only changes whitespace, indentation, and keyword casing. The query logic stays exactly the same.

Does it uppercase SQL keywords?

Yes. Keywords like SELECT, FROM, WHERE, and JOIN are uppercased by default, which is a common SQL style convention that makes queries easier to scan.

EchoBeaver — Free browser tools