SQL Formatter

Format SQL queries with consistent keywords and indentation.

Runs in your browser Developer Tools Free · No account

Input

Processed locally

This tool runs entirely in your browser. The data you paste or load is never uploaded.

Result

Enter your input, then run the tool.

About this tool

Adds line breaks before major clauses and aligns keywords in upper, lower or original case. String literals and comments are left untouched, so a formatted query can be pasted back into a client unchanged.

How to use it

  1. Paste a query, however compressed it is.
  2. Choose keyword case and indentation.
  3. Format, then copy the readable query.

Frequently asked questions

Does it validate SQL?
No. It is a layout tool; syntax is preserved rather than checked. Run the query against a database to validate it.
Are vendor-specific statements supported?
The common clauses are recognised. Less common dialect syntax is still kept intact, just with fewer line breaks.

Keep going

More in this category