About this tool
Uses the sql-formatterlibrary rather than a hand-rolled parser, since SQL dialects have enough syntax variation that a naive formatter would get many real queries subtly wrong.
Format and beautify SQL queries for readability. Runs entirely in your browser.
Uses the sql-formatterlibrary rather than a hand-rolled parser, since SQL dialects have enough syntax variation that a naive formatter would get many real queries subtly wrong.
Copy this HTML to cite this tool from your own site or article.
SQL Formatter formats unformatted SQL queries with consistent keyword capitalization, line breaks, and indentation across major SQL dialects.
Input: select id,name from users where status='active' Formatted: SELECT id, name FROM users WHERE status = 'active'
No. Formatting adjusts keyword casing and indentation whitespace while keeping query semantics identical.
Yes. Single-line (-- comment) and block (/* comment */) SQL comments remain in place.