SQL Formatters

Make SQL readable in the dialect you actually use. Formattr formats queries for Standard SQL, MySQL, MariaDB, PostgreSQL, SQL Server, Oracle PL/SQL, SQLite, BigQuery, Snowflake, Spark, Redshift and Trino, with your choice of keyword case, indentation and comma style — and minifies them back to one line when a config field or log needs it.

Action

Common tasks

About sql tools

SQL gets its own category because dialect matters. Quoting rules, parameter placeholders and keywords differ between databases, and a formatter that treats every query as generic SQL will mangle backtick identifiers, PostgreSQL casts or SQL Server brackets. Formattr uses the sql-formatter library with a real tokenizer per dialect, and hints when your query looks like it belongs to a different one.

Comments are preserved, placeholders such as ?, :name, $1 and @p stay untouched, and multiple statements separated by semicolons are formatted with the blank lines you choose. When the tokenizer cannot parse something it tells you where, suggests a fix for common keyword typos like FORM instead of FROM, and offers a best-effort format anyway.

Queries copied from slow-query logs, ORMs and BI dashboards are the typical input. Your SQL stays in your browser — table names and literal values never reach a server.

Frequently asked questions

Which SQL dialects are supported?

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

Does the formatter check my query is valid?

It tokenizes the query, so it catches unterminated strings and unknown syntax, but it does not check tables or columns exist — that needs your database.

Is it safe to paste production queries?

Yes. Formatting happens in an isolated frame in your browser that cannot make network requests, so table names, customer identifiers and literal values in your SQL are never sent anywhere or logged.

Are comments kept?

Yes, both -- line comments and /* block */ comments are preserved in formatted output. The minifier removes them unless you choose to keep them.

More categories