Get started
HomeDeveloper ToolsSQL Formatter
Developer ToolsRuns in your browser · files never uploaded

SQL Formatter

Pretty-print SQL

4.5· 59 votes
Your file never leaves this browser. Everything runs on your device — no uploads, no server storage, no retention.How it works →
Input235 chars
Formatted0 chars
Supports standard SQL plus dialect-specific syntax for PostgreSQL, MySQL, SQLite, BigQuery, and T-SQL.

What is SQL Formatter?

Pretty-print SQL across six dialects: standard, PostgreSQL, MySQL, SQLite, BigQuery, and T-SQL. Keyword case is configurable (upper, lower, or preserved) and indent width is 2 or 4 spaces. Useful for cleaning up a long query for code review, making a generated query human-readable, or reformatting inherited SQL to your team's style.

How do I use SQL Formatter?

  1. Paste SQL into the input panel.
  2. Pick the dialect and keyword case.
  3. Copy the formatted output.

When should I use SQL Formatter?

SQL Formatter is for read-layer cleanup. To minify SQL (rare), remove comments and collapse whitespace in your editor. For validating that a query compiles, run it in your target database — formatters don't validate.

Frequently asked
Which SQL dialects are supported?

ANSI, PostgreSQL, MySQL, SQLite, MS SQL, BigQuery, and Snowflake. Pick yours in the dialect dropdown — keyword recognition and reserved words differ.

Can it uppercase keywords?

Yes. Toggle "UPPERCASE KEYWORDS" for SELECT / FROM / WHERE style, or keep them as typed if you prefer lowercase house style.

Does it break long queries onto multiple lines?

Yes — SELECT clauses, JOINs, and WHERE predicates are wrapped consistently. Indent width is configurable (2, 4, or tab).

Is my file uploaded anywhere?

No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.

Related in Developer Tools
UUID Generator
Regex Tester
Cron Generator
Cron Parser
Timestamp Converter
Unix Time Converter
API Tester
Curl to Code