Instant • private • developer-friendly

SQL Formatter

Paste raw or minified SQL to get clean, indented output with keywords capitalized and placed on their own lines.

Raw SQL

Formatted SQL

🔒 Your SQL stays on your device and is never uploaded.

Make messy SQL readable

Paste a minified or inconsistently formatted SQL query to get it broken into clean lines, with major clauses like SELECT, FROM, WHERE, JOIN, GROUP BY and ORDER BY starting a new line and keywords capitalized for readability.

Clause-aware

Recognizes common SQL clauses and keywords to decide where new lines and indentation belong.

Configurable style

Choose 2 spaces, 4 spaces or tabs, and toggle automatic keyword capitalization.

Private by design

Formatting runs entirely in your browser. Nothing is uploaded.

SQL formatter FAQ

What SQL dialects does this formatter support?

It uses generic ANSI SQL keyword rules that work well for MySQL, PostgreSQL, SQL Server and SQLite queries. Dialect-specific syntax may not format perfectly.

Does it validate my SQL?

No. This is a formatter, not a parser or validator, so it will not catch syntax errors in your query.

Can I change the indent size?

Yes. Choose 2 spaces, 4 spaces or a tab from the indent option before formatting.

Is my SQL uploaded anywhere?

No. Formatting happens entirely in your browser using JavaScript.