SQL Formatter & Beautifier
Beautify and indent SQL queries instantly. Uppercase keywords, adjust indent, or minify for compact output.
Advanced — 2-space indent · Uppercase keywords
What is a SQL Formatter?
A SQL formatter (beautifier) re-indents and structures SQL queries for readability by placing major clauses on new lines and adding consistent indentation. It supports all standard SQL clauses: SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, HAVING, UNION, INSERT, UPDATE, DELETE, and more. The minify mode removes all unnecessary whitespace for compact SQL storage.
How to Use the SQL Formatter
- Paste your SQL into the input field.
- Choose Beautify or Minify.
- Click Format or press Ctrl+Enter.
- Open Advanced to set indent size and toggle keyword uppercasing.
- Click Copy to copy the formatted SQL.
When to Use This Tool
Use for debugging complex queries, preparing SQL for documentation or code review, formatting generated or minified SQL, or normalizing mixed-case queries. For JSON data queries, see the JSON Formatter. For regex-based text processing, try the Regex Tester.
Frequently Asked Questions
What does a SQL formatter do?
A SQL formatter re-indents and structures SQL for readability — adds line breaks, proper indentation, and optionally uppercases keywords.
Is my SQL sent to a server?
No. All formatting runs entirely in your browser. Your SQL is never uploaded or stored.
Which SQL dialects are supported?
Works with standard SQL keywords used in MySQL, PostgreSQL, SQLite, SQL Server, and Oracle.
Can I adjust the indent size?
Yes. Open the Advanced section to choose 2 spaces, 4 spaces, or tab indentation. You can also toggle keyword uppercasing.