๐Ÿ—ƒ๏ธ

SQL Formatter

Format a messy SQL query into readable, indented lines.

Advertisement
Ad slot: top
Advertisement
Ad slot: incontent

About the SQL Formatter

Paste a long single-line query and get it back with each clause on its own line, joins separated out, conditions indented and keywords in the case you prefer. String literals and quoted identifiers are protected so their contents are never touched.

The minify button does the reverse, collapsing a formatted query back to one line for embedding in code.

Frequently asked questions

Which SQL dialects work?

The formatter is dialect-agnostic for standard clauses, so MySQL, PostgreSQL, SQL Server and SQLite queries all format correctly.

Related tools

All Developer โ†’
Advertisement
Ad slot: bottom