Format any SQL query with proper indentation and consistent keyword casing. Paste minified or messy SQL and get a clean, readable version back. Supports multiple SQL dialects.
Formatting runs entirely in your browser.
The tool uses the sql-formatter library, a dialect-aware SQL pretty-printer that runs entirely in your browser. It parses your query and re-emits it with consistent indentation and capitalisation. No server required.
All formatting happens locally in your browser tab. Our servers are not involved at any point.
For inspecting JSON returned by queries, try the JSON formatter. To validate identifier patterns in your SQL, use the regex tester. For converting query results into structured rows, see CSV to JSON.
Select 'MySQL' from the dialect dropdown, paste your query, and click Format. The formatter will apply MySQL-appropriate keyword casing and indentation.
Yes. Paste multiple statements (separated by semicolons) and all will be formatted together.
The formatter only adjusts whitespace and formatting. If your SQL has syntax errors, they will remain after formatting, though the improved readability may help you spot them.