SQL Validator
SQL validator online. Check SQL syntax, find unclosed quotes and parentheses, and see parse errors with line numbers. Free SQL checker, no upload.
SQL
Loading editor...
Features
- Catch unclosed quotes, dollar quotes, and block comments
- Catch unmatched parentheses with a line and column
- Dialect-aware parse via the same engine as the formatter
- Count statements, JOINs, SELECTs, and mentioned tables
- Live check as you type, no upload
- Works for PostgreSQL, MySQL, SQLite, SQL Server, BigQuery, Snowflake
Common Use Cases
- See why a paste from Slack will not run
- Confirm a hand-edited migration is at least parseable
- Count how many statements are in a script before you run it
- List tables referenced in a messy query
- Check a query after a find-and-replace
Syntax check vs running the query
This tool checks syntax: quotes close, parentheses match, and the formatter’s parser can read the statement. It does not connect to a database. A query can be syntactically fine and still fail at runtime (unknown column, permission denied, bad JOIN).
It is also not a linter for anti-patterns. SELECT * and missing WHERE on DELETE are valid SQL. The explainer calls those out in English; the validator does not block them.
Examples
SELECT id FROM users WHERE active = TRUE;SELECT id FROM users WHERE (active = TRUE;INSERT INTO t (name) VALUES ('Ada);Frequently Asked Questions
No. There is no database here. The check is local parsing only.
The parser may treat unknown words as identifiers. FORM users can look like a table named FORM. Use the explainer or read the formatted output if something feels off.
No. We do not have your tables. Pair this with your engine’s EXPLAIN when you need a plan.
Tips
- Pick the dialect you will run. Postgres dollar quotes fail under MySQL.
- A DELETE without WHERE is valid SQL and dangerous. Read it twice.