Skip to main content
Toolzum

SQL Formatter

Formats SQL queries with proper keyword capitalization, indentation, and clause alignment for readable database operations.

Runs on sql-formatter

100% Local Browser Native

How to Use the SQL Formatter

1. Paste SQL

Paste SQL text into the input area. Nothing runs until you trigger it.

2. Format

Format with indent and style options.

3. Copy output

Copy the clean output for your project.

Similar Tools You Might Need

See all

Frequently Asked Questions

Which SQL dialects are supported?

MySQL, PostgreSQL, SQL Server, BigQuery, SQLite, Oracle, and Standard SQL. Each dialect applies the correct keyword syntax and function formatting.

Can I control keyword capitalization?

Yes. Choose between uppercase keywords (SELECT, WHERE, JOIN), lowercase (select, where, join), or original case. Uppercase is the most common convention.

Does it handle complex queries?

Yes. CTEs, subqueries, window functions, CASE expressions, JOINs, and nested queries are all formatted correctly with proper indentation and alignment.

Can it minify SQL instead of formatting?

Some formatters support minification. Check if this tool has a minify toggle — the primary function is pretty-printing for readability.

Is my query stored or transmitted?

No. All formatting happens locally in your browser using the sql-formatter library. No SQL is sent to any server.

Exactly how does it rewrite a query? Show one.

Only whole lowercase words from its keyword table (SELECT, FROM, WHERE, AND, OR, JOIN, ON, GROUP BY, ORDER BY, LIMIT, HAVING, UNION, VALUES, SET and more) are uppercased; every comma becomes comma-newline-2-spaces and a newline is forced before each major clause. So select a, b from t where x = 1 becomes SELECT a, then newline plus 2 spaces b, then newline FROM t, then newline WHERE x = 1.

Last updated October 2026