SQL Formatter
Re-indent SQL queries so major clauses start on their own line, uppercasing keywords while leaving string literals and comments exactly as written.
How to use
- Paste a query into the input.
- Set the indent width and whether to uppercase keywords.
- Copy the formatted query.
An SQL formatter puts FROM, WHERE, GROUP BY, and the rest of the major clauses on their own lines at a readable indent. Single quotes, quoted identifiers, and comments are tokenised, so their contents never change.
Paste or type something above.
Questions about sql formatter
- Does it uppercase my string values?
- No. Keywords are uppercased outside strings and comments only, so a literal such as 'from x' stays lowercase.
- Which dialect does it target?
- The clause set is common SQL. Dialect-specific syntax is left alone because it is passed through as written.
- Will it run the query?
- No. Nothing is sent anywhere. Formatting is text processing on your device.
Related tools
- SQL Minifier Collapse whitespace in SQL to remove blank lines and padding, keeping string literals inta...
- JSON Formatter Format minified or badly indented JSON into clean, readable output with your choice of ind...
- Regex Tester Test a regular expression against sample text and see every match with its position, captu...