Free SQL Formatter & Beautifier
Paste a raw or minified SQL query and beautify it with proper indentation and line breaks.
About This Tool
Free SQL formatter online — paste a messy, single-line, or minified SQL query and instantly get it beautified with proper indentation, capitalized keywords, and clauses (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY) each on their own line. Useful for making complex queries with multiple joins and subqueries readable during code review, debugging, or documentation. Works with common SQL dialects (MySQL, PostgreSQL, SQL Server, SQLite). Everything runs locally in your browser — your queries and any embedded data are never uploaded.
How to Use
- 1
Paste your SQL
Paste a raw or minified SQL query into the input box.
- 2
Format
Click Format to beautify the query with proper indentation and line breaks.
- 3
Copy the output
Copy the formatted SQL to your clipboard.