SQL Formatter
Beautify SQL queries with consistent indentation and keyword case for 16 database dialects.
Open toolCheck SQL for unclosed strings, unbalanced brackets, clause order, trailing commas, = NULL, UPDATE without WHERE and dialect mistakes.
Not yet professionally reviewed. This tool’s formulas and wording have not been checked by a qualified professional. Use the results as an estimate and verify anything important.
A lint for common mistakes, not a full parser for every dialect. Valid SQL can occasionally be flagged and some errors only your database will catch; test queries on a copy of the data before running them in production.
Paste one or more SQL statements and pick a dialect. The validator tokenises the SQL the way the database would (strings, quoted identifiers, comments, PostgreSQL dollar quoting and MySQL backslash escapes) and checks each statement for problems that cause errors or bad results: unclosed strings, comments and identifiers; unbalanced parentheses; double and trailing commas; clauses in the wrong order (WHERE after GROUP BY, ORDER BY before GROUP BY); HAVING without GROUP BY; INSERT column counts that don't match the VALUES; and LIMIT on SQL Server or TOP elsewhere.
It also flags risky statements: UPDATE or DELETE without WHERE, DROP and TRUNCATE, comparisons with = NULL (which are never true) and LIKE patterns without wildcards. Each finding shows the line number. The SQL is never executed. Everything runs in your browser. What you paste is never uploaded, logged or stored.
Your code or text
PostgreSQL, MySQL / MariaDB, SQLite, SQL Server
Processed in this browser
Instant, in-browser. Nothing is uploaded.
Your result
Ready to download or copy
Paste your SQL.
Choose the dialect.
Fix the errors from the top, then re-check.
Zero-upload architecture
Free, with no sign-up or watermark · Your files stay on your device
Launch the app and add your file. There is nothing to install and no account to create.
Choose the dialect.
Fix the errors from the top, then re-check.
Beautify SQL queries with consistent indentation and keyword case for 16 database dialects.
Open toolTurn CSV or JSON into INSERT statements, or a CREATE TABLE with inferred column types, for PostgreSQL, MySQL, SQLite or SQL Server.
Open toolCheck whether JSON is valid and see exactly where and why it fails, with fix suggestions.
Open toolValidate YAML syntax with exact line and column errors, duplicate-key detection and multi-document support.
Open tool