Readable layout
SELECT lists, GROUP BY and ORDER BY items go one per line; FROM, WHERE, JOINs and LIMIT each start a new line.
Make long or minified SQL readable, with consistent indentation and keyword case.
Format and beautify SQL queries: one clause per line, indented column lists, joins and subqueries, and uppercase keywords. Works for MySQL, PostgreSQL and more.
select id, name from users where active = 1 and city = 'Pune' order by name;SELECT
id,
name
FROM users
WHERE active = 1
AND city = 'Pune'
ORDER BY
name;Tip: Format queries before committing them: consistent layout makes diffs much easier to review.
SELECT lists, GROUP BY and ORDER BY items go one per line; FROM, WHERE, JOINs and LIMIT each start a new line.
Nested SELECTs are indented inside their parentheses and ON conditions sit under their JOIN.
UPPERCASE, lowercase or keep keywords as typed; identifiers and strings are never changed.
-- and /* */ comments stay in place on their own lines.
No. Only whitespace and keyword case change; strings, identifiers and values are left exactly as written.
Standard SQL plus common MySQL, PostgreSQL, SQLite and SQL Server syntax, including backtick and bracket identifiers and :: casts.
Yes. Statements separated by semicolons are formatted one after another with a blank line between them.
No. Formatting runs in your browser, so queries containing customer data stay private.