SQL Formatter

SQL Formatter formats and beautifies SQL queries for MySQL, PostgreSQL, SQL Server and more. Paste your query, choose a dialect, and click Format to indent and align it. All processing happens locally in your browser, and nothing is sent to a server.

Copied!

About SQL Formatting

SQL formatting reindents and aligns queries so they are easier to read and review. This tool supports multiple dialects including MySQL, PostgreSQL, SQL Server, SQLite and BigQuery, and lets you control keyword casing. Your query is formatted entirely in the browser and never sent anywhere.

A SQL formatter makes long or machine-generated queries readable before you review, debug or commit them. Teams use it to keep a consistent style in pull requests, to untangle queries copied from ORMs and logs, and to make complex joins and subqueries easier to follow during code review.

Paste a query, choose your dialect, MySQL, PostgreSQL, SQL Server, SQLite, MariaDB, BigQuery or PL/SQL, and the formatter re-indents clauses, aligns keywords and applies your preferred keyword casing. Everything runs locally, so queries containing sensitive table or column names never leave your machine.

Frequently Asked Questions

Which SQL dialects are supported?

It formats MySQL, PostgreSQL, SQL Server, SQLite, MariaDB, BigQuery and PL/SQL, plus standard SQL, so it matches the syntax of your database.

Will it change my query results?

No. It only reformats whitespace, indentation and keyword casing; the query logic and the data it returns stay exactly the same.

Is it safe to paste sensitive queries?

Yes. Formatting runs entirely in your browser, so queries containing internal table or column names are never sent to a server.