Developer Tools

SQL Formatter

Paste a minified or hand-written SQL query and get it back formatted with consistent capitalization, aligned clauses, and readable indentation. Perfect for reviewing query plans, sharing code in pull requests, or documenting database logic.

SQL Formatter

Free & no signup required

Results

How to Use This Tool
  1. Paste your SQL query into the input box
  2. Click "Beautify SQL" to format it
  3. Copy the formatted query into your editor or documentation
What is SQL Formatter?
SQL beautification (also called SQL formatting or pretty-printing) reformats a SQL statement so that keywords are consistently capitalized, clauses start on new lines, and nested subqueries are indented. ORMs and query builders often generate flat, unreadable SQL strings that are difficult to debug. Beautified SQL is easier to read in EXPLAIN output, simpler to share in code reviews, and clearer when documenting stored procedures. This tool supports standard SQL syntax including SELECT, INSERT, UPDATE, DELETE, CREATE, and complex JOIN and subquery patterns.
Related Tools