SQL Linter Online

Lint SQL for style, safety, and best practices with configurable rules and estimated quality scores.

Local onlyNo executionHeuristic lintNot schema-aware

How to Use

  1. Paste SQL or upload a .sql file
  2. Select your SQL dialect and lint preset
  3. Click Analyze SQL or enable auto-lint
  4. Review issues, scores, and recommendations
  5. Toggle rules, download reports, or apply style fixes

SQL Linter vs Validator vs Formatter

Use the Validator to catch syntax errors, the Linter to improve code quality, and the Formatter to prettify valid SQL. Together they form a practical pre-flight workflow before running scripts against a database.

Example: before and after review

-- Before (lint flags: SELECT *, comma join, DELETE without WHERE)
select * from users u, orders o
delete from logs

-- After team review
SELECT u.id, u.email, o.total
FROM users AS u
INNER JOIN orders AS o ON u.id = o.user_id;

DELETE FROM logs WHERE created_at < NOW() - INTERVAL '90 days';

Best practices

  • Avoid SELECT * in production queries
  • Use explicit JOINs instead of comma joins
  • Always scope DELETE and UPDATE with WHERE unless intentional
  • Pick one keyword casing convention per project
  • Validate syntax after fixing lint issues

Related tools

Frequently Asked Questions

What is an SQL linter?

An SQL linter analyzes SQL text for code quality issues such as unsafe mutations, poor style, readability problems, and common anti-patterns. It focuses on maintainability and best practices rather than executing queries.

How is a linter different from a syntax validator?

A syntax validator checks whether SQL can be parsed for a dialect. A linter checks style, safety heuristics, and maintainability rules. Valid SQL can still have lint issues.

How is a linter different from a formatter?

A formatter rearranges whitespace and casing for readability. A linter reports issues and recommendations; it does not change your SQL unless you choose to apply style fixes via the formatter handoff.

Does this tool execute SQL?

No. It never connects to a database and never runs your queries. Linting is static analysis only.

Is my SQL uploaded to a server?

No. All linting runs in your browser. Your SQL stays on your device.

Which SQL dialects are supported?

PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), Oracle PL/SQL, BigQuery, Snowflake, Redshift, DuckDB, DB2, Trino, Spark, Hive, ClickHouse, and generic SQL.

Can it replace SQLFluff or a CI linter?

No for teams needing full SQLFluff rule parity, Jinja/dbt templating, or native CI hooks. This tool is a fast browser-side linter for individuals and ad hoc review.

What lint rules are included?

Safety (SELECT *, DELETE/UPDATE without WHERE, DROP/TRUNCATE), style (line length, keyword casing, trailing spaces), readability (nesting depth, long queries), performance heuristics (leading wildcard LIKE, functions in WHERE), and security advisories (dynamic SQL patterns).

Can I enable or disable individual rules?

Yes. Expand Rule configuration in the results panel to toggle rules. Choosing a preset resets defaults; manual toggles switch to the Custom preset.

What presets are available?

Standard (balanced), Strict (more warnings), Relaxed (fewer style nits), and Safety only (dangerous operations and security advisories).

What are the lint scores?

Estimated scores from 0–100 for Safety, Style, Readability, Performance, and Security, plus an Overall score. They are heuristic estimates, not execution-tested metrics.

Does linting change my SQL automatically?

No. Use Apply style fixes to open the SQL Formatter with your current script if you want formatting changes.

Can it auto-fix issues?

Style-only fixes (indentation, keyword case, spacing) are available through the Formatter handoff. Logic-changing fixes are not applied automatically.

Does it check table and column names?

No. Without a schema or database connection, table/column existence cannot be verified.

Does it support stored procedures and triggers?

Partially. Complex procedural blocks may not be fully analyzable. Treat lint results as helpful but not exhaustive for procedural SQL.

Can it lint multi-statement scripts?

Yes. Statements are split on semicolons outside quoted strings and analyzed individually with statement indexes where relevant.

What is the maximum file size?

Small and medium scripts lint instantly. Inputs above ~300 KB use a Web Worker. Very large files may slow the browser; multi-gigabyte dumps are not supported in-browser.

Can I download a lint report?

Yes. Copy, download TXT, or download JSON reports from the results panel.

Can I open linted SQL in other tools?

Yes. Use Check syntax for the Validator, Apply style fixes for the Formatter, or hand off from other SQL tools into this linter.

What is max line length?

Configurable in the input panel (0 disables the rule). Standard preset uses 120 characters; Strict uses 100.

Are performance warnings accurate?

They are static heuristics only. The tool cannot measure real query plans, indexes, or execution time without running against a database.

Can I use this offline?

Yes. After the page loads, linting works offline because processing is client-side.

Does auto-detect dialect work perfectly?

No. It is heuristic only. Confirm the dialect manually when accuracy matters.

Will valid SQL always score 100?

No. Even valid SQL may trigger style or safety suggestions such as SELECT * or implicit joins.

Can I lint while typing?

Yes. Enable auto-lint for debounced live analysis, or click Analyze SQL / press Ctrl+Enter for immediate linting.

Does it show line numbers?

Yes when a rule can determine them. Click any issue to jump to the line in the editor.

What browsers are supported?

Modern Chromium, Firefox, Safari, and Edge browsers with Web Worker and localStorage support.

Is this tool free?

Yes. No account, usage limit, or per-query charge. All processing is local and free.

Why use a linter before code review?

Linting catches risky patterns and style drift early, making human review faster and more consistent across teams.

What keyboard shortcut runs lint immediately?

Ctrl+Enter on Windows/Linux or Cmd+Enter on Mac.