SQL Formatter

Format SQL queries with keyword breaks and indentation in your browser. Free SQL formatter for SELECT, INSERT, UPDATE, and more.

Result

Processed locally in your browser.

Advertisement

How to use this sql formatter

Paste a query and click Format. Major clauses such as SELECT, FROM, WHERE, and JOIN start on new lines. Keywords are uppercased.

Dialect-specific extensions may not get special treatment. Check the result before running it against production.

Advertisement

Example

select id, name from users where active = 1 becomes a multi-line query with SELECT / FROM / WHERE on their own lines.

Related tools

More formatting tools

  • JSON FormatterFormat, minify, and validate JSON in your browser. Paste JSON, pretty-print with 2-space indent, or compress to one line. Free, no signup.
  • JSON ValidatorValidate JSON syntax instantly in your browser. Paste JSON to see whether it parses, with a clear error if it does not. Free JSON checker.
  • HTML FormatterBeautify HTML with consistent indentation in your browser. Free HTML formatter, no signup, source stays on your device.
  • CSS MinifierMinify CSS in your browser: strip comments and extra whitespace. Free CSS minifier for quick compression, no upload.
  • JavaScript MinifierMinify JavaScript in your browser by removing comments and extra whitespace. Free JS minifier, source stays local.
  • XML FormatterPretty-print XML with nested indentation in your browser. Free XML formatter and beautifier, no signup.
Advertisement

Frequently asked questions

Which SQL dialect?

Generic ANSI-style layout. Postgres, MySQL, and SQL Server queries usually format well if they use common clauses.

Does it run the query?

No. It only reformats text. There is no database connection.

Is SQL uploaded?

Processed locally in your browser. We do not upload the text to compute a result.

Last reviewed 2026-08-19. Results stay on your device unless you copy them elsewhere.