SQL Formatter
Format and beautify SQL queries with configurable indentation and keyword casing.
Formatted SQL will appear here...How to use the SQL Formatter
- Paste your SQL query into the input box.
- Choose keyword casing (UPPERCASE or lowercase).
- Select indentation size.
- Click Format SQL to see the result.
About SQL Formatter
Long SQL statements are easier to review when clauses, joins, and nested expressions are laid out consistently. This SQL formatter uses the sql-formatter parser library to indent a query and optionally normalize keyword capitalization.
Formatting changes presentation, not query intent, and it does not execute SQL or connect to a database. Review the resulting query before using it, particularly when the input contains dialect-specific syntax or application-generated fragments.
How to use this tool
Paste a SQL statement, set keyword casing and indentation, then choose Format SQL. Review the formatted text before copying it into your editor.
Frequently asked questions
Does formatting run my SQL?
No. The tool only parses and formats query text in your browser. It never connects to or executes against a database.
Which SQL dialect should I use?
The current formatter uses its generic SQL language mode. Dialect-specific extensions may not be formatted exactly as your database expects.
Can a formatted query change its meaning?
The formatter is intended to change whitespace and keyword casing only. Still review the output and test it in a safe environment before running important queries.
Related Tools
JSON Formatter
Format, validate, and minify JSON data with syntax highlighting and error detection.
JWT Decoder
Decode and inspect JSON Web Tokens. View header, payload, and expiration info.
UUID Generator
Generate cryptographically secure UUID v4 values. Single or bulk generation.