SQL copied from application logs, ORM debug output or a colleague’s message is often one long unindented line. With a few JOINs, subqueries and CASE WHEN expressions stacked together, just finding the WHERE clause takes effort. This tool reformats as you paste or type: each major clause (SELECT, FROM, JOIN, WHERE, GROUP BY, ORDER BY) goes on its own line, column lists align one per line, and subqueries and parenthesized expressions are indented by depth so the structure is visible at a glance.
Indentation can be 2 spaces, 4 spaces or a tab to match your code style, and keyword case can be upper, lower or preserved. Many teams use uppercase keywords (SELECT, WHERE) with lowercase table and column names so syntax and data are easy to tell apart. If your project uses a linter, choose settings that match its rules to avoid format-only diffs in code review. One click copies the formatted result.
The tool uses the open-source sql-formatter library with the standard SQL dialect. Ordinary SELECT, INSERT, UPDATE, DELETE, CTEs (WITH) and window functions are handled correctly. Some database-specific syntax, such as certain MySQL, PostgreSQL or SQL Server extensions, may not parse; in that case the tool shows an error instead of producing a wrong result. Formatting only changes whitespace and case: it does not check that tables exist or that the query is semantically valid, and it never changes what the query returns.
Everything runs in your browser and queries are never uploaded. That matters when queries contain customer filters, internal table names or production statements. If a query includes real personal data or keys, replace them with sample values before sharing it with anyone.