About this tool
Format SQL safely and quickly.
Turn compact SQL into readable statements for reviews, documentation and debugging without uploading queries to a server.
What it handles
- Formats common SELECT, INSERT, UPDATE and DELETE statements
- Preserves quoted strings and comments
- Supports two- or four-space indentation
- Copy or download the formatted SQL
Practical guidance
Format SQL without changing what it is meant to do.
Use the formatter when a query is difficult to review because clauses, joins and conditions have been compressed onto one line. It changes presentation only: the tool does not connect to a database, execute the statement or deliberately rewrite query logic.
A simple review workflow
- Paste a query, open a .sql or text file, or load the included example.
- Choose two- or four-space indentation and whether common SQL keywords should be uppercase.
- Format the statement, then compare the result with the original before using it.
- Copy the formatted SQL or download it as a text file for review and version control.
Review before execution
- Check vendor-specific functions, procedural blocks and templating syntax.
- Confirm quoted identifiers and string literals still express the intended values.
- Run the query in a safe development environment before applying it to production data.
Common questions
SQL Formatter FAQ
Which SQL dialects are supported?
The formatter handles common SQL syntax shared by PostgreSQL, MySQL, SQL Server, Snowflake, BigQuery and similar systems. Vendor-specific syntax may need manual adjustment.
Does this tool execute my SQL?
No. It only changes layout and capitalization. It never connects to a database or runs the query.
Is confidential SQL uploaded?
No. Formatting happens locally in your browser. Avoid placing credentials or secrets in any document unnecessarily.