EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

SQL formatter

Format SQL queries online: line breaks at clauses, indentation, uppercase keywords and a minify option.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Format and convert

Paste your SQL query.

Available in: PortuguêsEspañolEnglish

Advertisement

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

  1. Paste the SQL query.
  2. Choose the formatting options.
  3. 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.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.