Quick answer
Format messy, single-line SQL into clean, properly indented queries — supports MySQL, PostgreSQL, SQLite, SQL Server and more. House of Convert's SQL Query Formatter is free, needs no sign-up, and nothing you paste is stored.
About the SQL Beautifier & Formatter
This free SQL formatter and beautifier turns long one-line queries into clean, readable SQL. Choose your dialect — MySQL, PostgreSQL, SQL Server, SQLite, MariaDB, BigQuery or Snowflake — and uppercase keywords if you like.
Turn long single-line SQL into clean, readable queries with proper indentation and line breaks. Pick your dialect — MySQL, PostgreSQL, SQL Server (T-SQL), SQLite, MariaDB, BigQuery, Snowflake or standard SQL — and choose whether keywords are UPPERCASE or left as typed.
Popular Ways to Use the SQL Beautifier & Formatter
Format SQL online
Paste the query and choose your dialect.
SQL beautifier for PostgreSQL
Choose PostgreSQL for dialect-aware formatting.
Uppercase SQL keywords
Choose UPPERCASE.
Format SQL without Notepad++ or SSMS plugins
Works in any browser.
Multiple statements
Separate them with semicolons.
Frequently Asked Questions
How do I format SQL?
Paste your query into the box, choose the dialect you use (MySQL, PostgreSQL, SQL Server, SQLite, MariaDB, BigQuery, Snowflake or standard SQL) and click Format. Each clause starts on its own line with consistent indentation, ready to copy back into your editor.
What is SQL formatting?
Adding consistent indentation and line breaks so queries are easy to read.
How do I format a SQL query?
Paste it here and click Format. SELECT, FROM, JOIN, WHERE, GROUP BY and ORDER BY each go on their own line, column lists and conditions are indented beneath them, and you can switch keywords to UPPERCASE so the structure stands out.
How do I format SQL in VS Code?
Use a SQL formatter extension; this page needs nothing installed.
How do I format SQL in SSMS?
SQL Server Management Studio has no built-in beautifier, so most people install a paid plugin. Instead, copy the query from SSMS, paste it here with the SQL Server (T-SQL) dialect selected, click Format and paste the clean result back.
What is an SQL formatter?
An SQL formatter, or SQL beautifier, rewrites a query with consistent line breaks, indentation and keyword case without changing what it does. It turns a long one-line query from logs, an ORM or a colleague into something you can read and review.
Which SQL dialects are supported?
Standard SQL, MySQL, PostgreSQL, SQLite, MariaDB, SQL Server, BigQuery and Snowflake.
Why format SQL?
Formatted SQL is far easier to read, review and debug: you can see each join, filter and subquery at a glance, spot a missing condition quickly and keep a consistent style in code reviews and version control, where clean diffs matter.
Does formatting change what the query does?
No. Only whitespace, line breaks and, if you choose, keyword case change. Table names, column names, string values and the logic of the query stay exactly the same, so the formatted query returns the same results as the original.
Does the SQL Query Formatter store my query?
No. The query is formatted and then discarded immediately; nothing is saved or logged, so it is safe to format queries that contain table names or business logic. For real passwords or personal data, replace them with placeholders first as a good habit.