Overview
Paste a SQL statement and get it reformatted by the sql-formatter package - a purpose-built SQL parser and pretty-printer, not a regex keyword-matcher - so keywords are capitalized (SELECT, FROM, WHERE, JOIN, and friends normalized to uppercase) and each major clause breaks onto its own line with AND/OR conditions and comma-separated columns indented underneath. Because it parses SQL structure rather than pattern-matching on keywords, it handles nested subqueries, comments, and nuanced clause boundaries far more reliably than a hand-rolled formatter would. Pick a dialect - Standard SQL, MySQL, PostgreSQL, T-SQL, SQLite, or PL/SQL - to match dialect-specific syntax quirks. Runs entirely client-side; nothing you paste is uploaded.
Best for: Making a dense one-line query reviewable in a PR
How to use this tool
- Paste your SQL. A SELECT, INSERT, UPDATE, or DELETE statement, however it’s currently formatted.
- Pick a dialect. Standard SQL, MySQL, PostgreSQL, T-SQL, SQLite, or PL/SQL - each has its own parser rules.
- Parsed and reformatted. sql-formatter parses the query’s real structure and reprints it with consistent casing and indentation.
- Copy the readable result. Paste the formatted query into a PR, a code review, or documentation.
Why use this tool
Real SQL parsing, not regex
Built on the sql-formatter package, which parses clause structure instead of guessing from keyword patterns.
Consistent keyword casing
Every SELECT, FROM, and WHERE is capitalized the same way, regardless of how it was typed.
Handles nested queries and comments
Subqueries, joins, and inline comments are preserved and indented correctly, not just top-level clauses.
Multiple dialects supported
Switch between Standard SQL, MySQL, PostgreSQL, T-SQL, SQLite, and PL/SQL to match your database.
Frequently asked questions
It supports the dialects listed in the picker (Standard SQL, MySQL, PostgreSQL, T-SQL, SQLite, PL/SQL), each with its own parser rules from the underlying sql-formatter package. Other dialects the package supports (BigQuery, Snowflake, Redshift, and more) aren’t exposed in this picker, and highly vendor-specific extensions beyond what a given dialect’s parser recognizes may not format as expected.
A regex-based formatter can misfire on SQL embedded inside string literals, nested subqueries, or unusual clause ordering, because it has no real understanding of the query’s structure. A parser-based formatter builds an actual representation of the query first, so it reprints it correctly even for cases that would trip up simple keyword replacement.
No - this only formats SQL text. It never executes a query, never opens a database connection, and never sends anything you paste to a server; formatting happens entirely in your browser.