SQL Formatter
Format SQL queries with consistent keywords and indentation.
Input
This tool runs entirely in your browser. The data you paste or load is never uploaded.
Result
Enter your input, then run the tool.
About this tool
Adds line breaks before major clauses and aligns keywords in upper, lower or original case. String literals and comments are left untouched, so a formatted query can be pasted back into a client unchanged.
How to use it
- Paste a query, however compressed it is.
- Choose keyword case and indentation.
- Format, then copy the readable query.
Frequently asked questions
Does it validate SQL?
No. It is a layout tool; syntax is preserved rather than checked. Run the query against a database to validate it.
Are vendor-specific statements supported?
The common clauses are recognised. Less common dialect syntax is still kept intact, just with fewer line breaks.
Keep going
Related tools
JSON Formatter
Pretty-print compact or broken JSON with a readable indentation.
CSV to JSON Converter
Convert CSV rows into structured JSON, with type detection.
JavaScript Minifier
Strip comments and blank lines from JavaScript safely.
JSON Validator
Check JSON syntax and see exactly where it breaks.
JSON Minifier
Strip whitespace from JSON to shrink payloads.
JSON to CSV Converter
Turn an array of JSON objects into a spreadsheet-ready CSV.