Free SQL Formatter

Format and beautify SQL queries with configurable indentation and dialect support. Runs in your browser — your data never leaves your machine.

SQL Input
Formatted SQL

🔒 100% Private

All formatting happens in your browser using JavaScript. Nothing is uploaded to any server. Safe for sensitive business queries.

🗄️ Multiple Dialects

Supports Standard SQL, MySQL, PostgreSQL, SQL Server, and SQLite. Choose your dialect for accurate formatting.

🔠 Uppercase Keywords

Optionally convert all SQL keywords to uppercase for consistent, professional-looking queries.

How to Format SQL Online

Paste your SQL query into the input panel and click Format. The formatter applies consistent indentation, line breaks, and keyword casing to make your query readable. Choose your SQL dialect, indentation style, and whether to uppercase keywords. Copy the formatted result or download it as a .sql file.

Supported SQL Dialects

The formatter supports Standard SQL, MySQL, PostgreSQL, SQL Server (T-SQL), and SQLite. Each dialect has its own keyword set and formatting conventions. Selecting the correct dialect ensures that dialect-specific syntax like backticks (MySQL), square brackets (SQL Server), or double-quoted identifiers (PostgreSQL) is handled properly.

Frequently Asked Questions

What SQL dialects are supported?
The formatter supports Standard SQL, MySQL, PostgreSQL, SQL Server (T-SQL), and SQLite. Select your dialect from the dropdown to get dialect-specific formatting.
Can I uppercase keywords?
Yes — use the toggle button to convert all SQL keywords (SELECT, FROM, WHERE, etc.) to uppercase for consistent, readable queries.
Can I choose indentation?
Yes — choose between 2 spaces, 4 spaces, or tab indentation to match your team's coding style.
Is this formatter free?
Yes — completely free, forever. No sign-up, no account, no usage limits.
Is my data safe?
All formatting happens locally in your browser using JavaScript. Your SQL is never uploaded to any server. It's safe to use with sensitive or proprietary queries.
Does it validate SQL?
No — this tool formats SQL for readability only. It does not check for syntax errors or validate your queries. For syntax checking, use a dedicated SQL validator.