Support
Dev Tools / Format SQL Queries

Browse by category

All categories

Format SQL Queries

Format and beautify SQL queries with syntax highlighting and dialect support. Nothing logged, nothing sent.

1
Paste SQL
Paste your SQL query into the input area
2
Format
The query is formatted with proper indentation and keyword casing
3
Copy result
Copy the formatted SQL query

SQL Input

SQL Output

Formatted SQL will appear here...
  • Tokenizer is dialect-agnostic — handles standard SQL plus MySQL backticks and PostgreSQL double-quoted identifiers.
  • Multi-line comments (/* … */) and single-line (-- …) are preserved on their own lines.

Frequently Asked Questions

Which SQL dialects are supported?

Standard SQL, MySQL, PostgreSQL, Microsoft SQL Server, and Oracle.

Can I customize the formatting style?

Yes. Configure indentation, keyword casing, and comma placement.

Is it safe to paste production data?

Yes. Formatting is a pure-JS parser running in your browser. Query strings with PII, internal table names, or production credentials stay on your device.

This tool is free thanks to our sponsors. Support Loft Tools