SQL Formatter

Language:

Keywords:

Indent:

Input
Result
How to use
  1. 1.

    Paste your SQL query into the Input panel

  2. 2.

    Select the SQL dialect that matches your database

  3. 3.

    The formatted result appears instantly in the Result panel

  4. 4.

    Adjust keyword case or indent width as needed - the output updates automatically

Common uses
  • Cleaning up minified or auto-generated SQL before reviewing it

  • Formatting queries from ORM debug output for readability

  • Standardising keyword casing across a team codebase

  • Quickly checking query structure without running it

Frequently asked questions
Which SQL dialects are supported?

The tool supports standard SQL, MySQL, PostgreSQL, SQLite, BigQuery, and T-SQL (Microsoft SQL Server) via the sql-formatter library.


Does it validate SQL syntax?

The formatter restructures whitespace and keywords but does not execute or validate the query against a database schema.


Is my SQL sent to a server?

All formatting runs locally in your browser using the sql-formatter library. No queries are transmitted anywhere.


Can I format stored procedures and subqueries?

The formatter handles complex queries including subqueries, CTEs (WITH clauses), JOINs, and most stored procedure syntax.


What does keyword case do?

Keyword case controls whether SQL keywords like SELECT, FROM, and WHERE appear in UPPERCASE or lowercase in the formatted output.