SQL Formatter

Format and beautify SQL queries online. Uppercase keywords, indent joins and subqueries, choose comma-first style or minify to one line. Works with common dialects.

  • Free, no sign-up
  • Runs in your browser
  • Your data stays private

How to use the SQL Formatter

  1. Paste your SQL query or script.
  2. Choose formatted or minified layout, indent size and keyword case.
  3. Copy the formatted SQL.

Why use this SQL Formatter

  • Readable layoutClauses, joins, AND and OR conditions and subqueries each get their own indented lines.
  • Keyword and function caseUppercase, lowercase or keep as written.
  • Comma-first stylePlace list commas at the start of lines if your team prefers it.
  • MinifyCollapse a query to a single line and turn line comments into block comments.

Frequently asked questions

How do I format a SQL query?

Paste the query. It is formatted instantly with each clause on its own line.

Does it support subqueries and CASE?

Yes. Subqueries are indented and CASE blocks are aligned.

Does it change my query logic?

No. Only whitespace and the letter case of keywords change; strings and identifiers are preserved.

Related tools

More Developer Tools

User Reviews

–
No ratings yet
Write a review
Your rating *

Your email is never published. Reviews are moderated, and links aren't allowed.

What users are saying

No reviews yet

Be the first to share your experience with this tool — your feedback helps others.