What is this tool?
SQL (Structured Query Language) is the standard language for relational database management. As queries grow in size and complexity, they often become dense and unreadable. An SQL Formatter adds consistent spacing, proper line breaks before major query keywords (like FROM, WHERE, JOIN), and aligns indentation to make code legible and easy to debug.
How to use it
1. Paste your raw, minified, or messy SQL query into the input field.
2. Choose your preferred keyword case (UPPERCASE, lowercase, or preserve) and indentation style.
3. The query will format in real time as you edit.
4. Click "Minify" if you want to compress the query into a single line, or click "Copy" to save the result.
Pro tips
- Comments (both single-line `--` and multi-line `/* ... */`) are preserved during formatting.
- Parenthesized subqueries are automatically indented relative to their parent clause for readability.