Format PostgreSQL queries with indentation, keyword casing, and line breaks tuned for the PostgreSQL dialect. Paste compact or messy SQL and get a clean, readable layout. All formatting runs in your browser.
Formatting runs entirely in your browser.
The tool uses the sql-formatter library, a dialect-aware SQL pretty-printer that runs entirely in your browser. It parses your query and re-emits it with consistent indentation and capitalisation. No server required.
All formatting happens locally in your browser tab. Our servers are not involved at any point.
For inspecting JSON returned by queries, try the JSON formatter. To validate identifier patterns in your SQL, use the regex tester. For converting query results into structured rows, see CSV to JSON.
Standard SQL plus PostgreSQL-specific syntax: RETURNING clauses, JSONB operators, double-quoted identifiers, CTEs, window functions, and dollar-quoted strings used in functions.
Formatting only adjusts whitespace and capitalisation. Syntax errors are preserved in the output, though the cleaner layout often makes them easier to spot and fix.
Yes. The formatter aligns WITH clauses, OVER() expressions, and PARTITION BY/ORDER BY for readability.
All formatting runs in your browser using JavaScript. Our servers are not involved at any point.