~/tools / SQL Formatter
SQL Formatter
Format a SQL query for readability, or minify it to one line. A keyword-based formatter that breaks before major clauses (SELECT/FROM/WHERE/JOIN, etc.).
Useful for turning a one-line SQL query from a log or tool output into something reviewable, or for the reverse — minifying it before embedding in application code.
# Use Cases
- Formatting a one-line SQL query dumped from a log tool or APM so it's reviewable
- Making sense of someone else's query full of JOINs and WHERE clauses
- Minifying a query before embedding it in application code
# Usage
- Paste the SQL query you want to format or minify into the text area.
- Click "Format" for a readable, clause-broken layout, or "Minify" to collapse it to one line.
# FAQ
- Does this support every SQL dialect?
- It performs generic, keyword-based formatting that isn't tied to a specific RDBMS. Complex subqueries or vendor-specific syntax may not break the way you expect.
- Does it check for SQL injection?
- No, this is a formatting tool only, not a security scanner. Use a dedicated static analysis tool for that.
# Related
# Learn more on our sister sites
- Learn SQL
Start from SELECT and build up — prodou.net