Nifty / Tools / SQL

PostgreSQL Formatter

Paste a query to format it. Comments are kept, and you choose the keyword case and indentation.

postgresql-formatter
SQLDrop a file here
Formatted
Loading…

Runs in your browser. Nothing you paste is uploaded or stored.

How to use the PostgreSQL Formatter

  1. Paste SQL on the left.
  2. Pick the dialect, keyword case and indentation.
  3. Copy the formatted query.

Questions

Is my data uploaded anywhere?

No. The tool runs entirely in your browser. Nothing you paste or drop is sent to a server, logged or stored, so it's safe for API responses, config files and other private data.

Which SQL dialects are supported?

Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (Transact-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, Spark, Hive, Trino, DB2 and more.

Does it support dbt and Jinja templates?

Yes. {{ }} and {% %} blocks are kept intact while the SQL around them is formatted.

Related tools