SQL Beautifier

What is SQL Beautifier?

SQL Beautifier takes a cramped, minified, or inconsistently formatted SQL query and rewrites it with clean line breaks and indentation, so the structure of the query becomes obvious at a glance. It understands real SQL syntax rather than doing naive text splitting, which means clauses, subqueries, joins, and case expressions all end up where they belong.

Features

  • Dialect support — PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), and Oracle PL/SQL, plus a generic standard SQL mode
  • Keyword casing — Uppercase (SELECT), lowercase (select), or preserve your original casing
  • Custom indentation — Choose how many spaces each nesting level gets
  • Multi-statement scripts — Format several queries at once, separated by blank lines
  • Syntax error surfacing — If your SQL cannot be parsed, the parser's error (with line and column) is shown so you can fix the actual mistake
  • Works on huge queries — Inputs up to 200k characters

How to use

1. Paste your SQL into the input panel on the left.

2. Pick your database dialect from the toolbar — when in doubt, Standard SQL works for most queries.

3. Choose a keyword case and indentation width.

4. The formatted result appears instantly on the right. Copy it or download it as a .sql file.

Privacy

All formatting runs entirely in your browser using a local parser. Your queries — which may contain sensitive table or column names — are never sent to any server.

Read the full SQL Beautifier guide and the SQL Beautifier API reference.