SQL formatter
Format SQL queries online: line breaks at clauses, indentation, uppercase keywords and a minify option.
How to usePaste your SQL query.
SQL formatter: what it is for
Paste a SQL query and the tool puts each clause (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY) on its own line, indents subqueries and lists the columns one per line.
Choose uppercase or lowercase keywords, the indentation and minify mode. Strings and comments are not changed.
How to use
- Paste the SQL query.
- Choose the formatting options.
- Copy the formatted SQL.
When to use it
- Reading long queries generated by ORMs.
- Standardizing SQL before code review.
- Documenting report queries.
Frequently asked questions
Does it work with MySQL, PostgreSQL and SQL Server?
Yes. Formatting uses the common keywords of standard SQL, so it works for most databases. Strings, comments and quoted names are not changed.
Is the query sent anywhere?
No. Everything happens in your browser; the tool does not connect to any database.
Is it really free?
Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.