🗄️

SQL Formatter

Beautify and format messy SQL queries with proper indentation and keyword highlighting. Free, instant, runs entirely in your browser.

💻 Developer Tools Free Browser-based
Tool
Formatted SQL will appear here…

Why Format SQL?

Minified or hand-written SQL queries quickly become impossible to read — especially when they contain nested subqueries, multiple JOINs, or long WHERE clauses. The SQL Formatter adds consistent indentation, capitalises reserved words and breaks each clause onto its own line so the logic is immediately clear.

SQL Keyword Reference

ClausePurpose
SELECTChoose columns to return
FROM / JOINSpecify source tables
WHEREFilter rows
GROUP BYAggregate rows
HAVINGFilter aggregated results
ORDER BYSort output
LIMIT / OFFSETPaginate results

Tips

Consistent SQL formatting helps code reviewers spot logic errors faster. It is also useful before pasting queries into documentation, Slack or README files. All processing happens in your browser — no query is ever sent to a server.

Frequently Asked Questions