SQL Formatter & Beautifier

Format messy SQL into readable, indented queries instantly.

Formatted SQL will appear here.

Paste a single-line or messy SQL query to format it with clause keywords (SELECT, FROM, WHERE, JOIN…) on their own lines and the column list indented for readability. Useful for code review, debugging and documentation. Formatting runs locally in your browser.

How to use the SQL Formatter

  1. Paste your SQL query into the input box.
  2. Choose an indent size and click Format SQL.
  3. Copy the formatted query.

Frequently asked questions

Which SQL dialects are supported?

It formats standard clause keywords common to most dialects (MySQL, PostgreSQL, SQL Server, SQLite). It re-indents rather than rewriting your SQL, so dialect-specific syntax is preserved.

Does it change my query's meaning?

No. It only adjusts whitespace and capitalises recognised keywords — the query logic is untouched.