SQL formatter
Paste a query and get a readable version with line breaks and indentation.
Workspace · SQL formatter
How to use it
Paste the SQL query.
Press Format to add line breaks and upper-case keywords.
Minify if you need a single line.
Examples
Query with JOIN
SELECT u.name FROM users u JOIN orders o ON o.user_id = u.id is split across lines.
Complex WHERE
AND and OR are indented so the condition is easy to read.
What you need to know
The formatter recognises common SQL clauses (SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT…) and respects quoted strings. It does not execute the query or connect to any database.
Frequently Asked Questions
Related tools
Other tools that can help with similar tasks.
SQL Query Generator
Generates SELECT, INSERT, UPDATE and DELETE queries with validated tables and columns.
JSON formatter and validator
Formats, validates and organises JSON with error detection.
CSV to JSON Converter
Converts a CSV table into a ready-to-use JSON array.
