SQL Validator
Paste a query to check whether it is valid SQL for your database. Errors show the exact line and column, and common typos like LIMT or WHER are named.
SQL
Checks syntax only, not tables or columnsRuns in your browser
How to use the SQL Validator
- Choose your database dialect.
- Paste or type your SQL. It is checked as you type.
- If there is an error, the line is highlighted and the message says what was found and what was expected.
- Fix it, and the status turns green when the whole script parses.
Examples
Input
SELECT id FROM t ORDER BY id LIMT 10Result
Unexpected “LIMT” at line 1, column 30. Did you mean LIMIT?Input
SELECT 1;
SELECT 2;Result
Valid MySQL syntax: 2 statements.What it does
- A real SQL grammar
- Each dialect is checked with a full parser grammar (node-sql-parser), not pattern matching. Its grammar loads only when you pick that dialect.
- Ten dialects
- MySQL, MariaDB, PostgreSQL, SQL Server (T-SQL), SQLite, BigQuery, Snowflake, Redshift, Trino and Hive.
- Exact error position
- The failing line is highlighted in the editor, with the column and the tokens the parser expected.
Frequently asked questions
Does it check that my tables and columns exist?
No. It checks syntax only. It has no access to your database, so a query can be valid here and still fail if a table or column name is wrong.
Why is a query that runs on my database marked invalid?
Every database has rare extensions, and a parser grammar may not cover all of them. If you are sure the query runs, it is probably a less common feature. The SQL Formatter can still format it.
Is Oracle supported?
Not yet for validation. The SQL Formatter supports Oracle PL/SQL formatting.
Is anything I paste sent to a server?
No. It runs entirely in your browser. Nothing you paste or upload is sent, logged or stored.