SQL Formatter (PostgreSQL)
This SQL formatter makes PostgreSQL queries and DDL easy to read: one clause per line, consistent keywords and indentation.
What you get
- A PostgreSQL SQL formatter: format SQL online with the real Postgres parser, a SQL beautifier that cannot change what your query means.
- Checked: the formatted SQL is parsed again and compared with yours as a syntax tree.
- Private and free: everything runs in your browser, nothing is uploaded, and there is no sign-up.
How each result is checked
- Your SQL is parsed with the real PostgreSQL parser (libpg-query, compiled to WebAssembly).
- The formatted SQL is parsed again and its syntax tree compared with the original, so it means exactly the same thing.
What can't convert exactly
- Comments are not part of the syntax tree, so the formatted output leaves them out.
- Only PostgreSQL syntax is supported.
Questions
Can formatting change what my query does?
No. Both versions are parsed by PostgreSQL's own parser and must give identical syntax trees, statement by statement.
Is my data uploaded?
No. Everything runs in your browser, in a background worker. Nothing is sent to a server.
Does it format MySQL or SQL Server queries?
It is a PostgreSQL formatter: queries are read by PostgreSQL’s own parser, so PostgreSQL-specific syntax is understood exactly. Standard SQL that PostgreSQL accepts also works; MySQL- or SQL Server-only syntax is reported as an error.
How do I use the SQL Formatter (PostgreSQL) online?
Paste your input or open a file on the left. The result appears on the right as you type, already checked; copy or download it. Nothing is uploaded: the SQL Formatter (PostgreSQL) runs in your browser.