sql

SQL Formatter

Format and beautify SQL queries client-side with support for popular dialects. Your queries never leave the browser.

Paste SQL and click Format. Queries are beautified locally with support for popular dialects.

Input
Formatted output

What this SQL formatter does

Format and beautify SQL queries with support for MySQL, PostgreSQL, SQLite, SQL Server, BigQuery, Snowflake and other dialects. Formatting happens in your browser, so your queries — including any embedded data — never leave the page.

How it works

Tokenize. The query is split into tokens: keywords, identifiers, strings, numbers, and punctuation.
Respect strings and comments. Content inside string literals and comments is never reformatted or re-cased, so your data stays byte-for-byte identical.
Layout. Clauses such as SELECT, FROM, WHERE and JOINstart on new lines, and subqueries are indented. Choose uppercase or lowercase keywords to match your house style.
Dialect-aware. Picking the right dialect improves formatting of dialect-specific syntax like PostgreSQL array operators or MySQL's ON DUPLICATE KEY.

Frequently asked questions

How do I format SQL?

Paste your SQL into the input pane and click Format. The query is beautified with consistent indentation and keyword casing.

Which SQL dialects are supported?

Popular dialects including MySQL, PostgreSQL, SQLite, and SQL Server.

Does formatting upload my query?

No. Formatting runs entirely in your browser, so your queries never leave the page.

Does SQL Formatter upload my data?

No. SQL Formatter runs entirely in your browser — your input never leaves this page.

Is SQL Formatter free to use?

Yes. SQL Formatter is completely free, with no account and nothing to sign up for.

Updated 2026-08-07 · Runs in your browser — your data never leaves this page.