$devtoolkit.sh/tools/sql-formatter

SQL Formatter

Format and beautify SQL queries with proper indentation and uppercase keywords.

$sql input
0 chars1 lines
$formatted sql[READY]
0 chars1 lines

Related Tools

FAQ

Which SQL dialects are supported?
The formatter handles standard SQL syntax and works with MySQL, PostgreSQL, SQLite, and SQL Server queries. Dialect-specific functions are preserved as-is.
Does it handle subqueries?
Yes. Subqueries inside parentheses are indented an additional level so the nesting structure remains visible.
Are comments preserved?
Single-line (--) and multi-line (/* */) SQL comments are preserved in the formatted output.

Paste any SQL query and get it back cleanly formatted with uppercase keywords, consistent indentation, and newlines before major clauses like SELECT, FROM, WHERE, JOIN, ON, GROUP BY, ORDER BY, HAVING, LIMIT, INSERT, UPDATE, DELETE, CREATE, ALTER, and DROP.

/tools/sql-formatterv1.0.0