No upload, no server
Paste SQL,
let the browser format and review it
Paste a statement and it is laid out again for PostgreSQL, MySQL or SQLite, while unbalanced brackets and quotes, SELECT *, UPDATE or DELETE without WHERE, a leading wildcard and functions wrapped around a column are reported with line numbers. CREATE TABLE becomes a column, type, NULL, default, PK, FK and index summary. Zero input sent to a server (advertising and affiliate widgets excepted).
- Three dialects
- Format and minify
- 26 lint rules
- DDL index summary
- Markdown and JSON report
- Zero input sent
Input
Several statements are fine. Up to 256 KB is processed, and comments and string literals are preserved.
Result
Diagnostics
The download name follows the active tab: query.sql, query.min.sql, sqllint-report.md or sqllint-report.json.
DDL summary
No CREATE TABLE statement yet. Paste DDL to get columns, keys and indexes as a table.
How to read it
- The formatter never reorders tokens, it only re-lays-out whitespace.
- Fix any statement marked as an error before running it. Warnings are advice about indexes and safety.
- In the DDL summary the key column stands for PK, FK, UQ and CK.
Everything is computed in this browser. Input is never sent to a server.
How it works
- 01Paste the SQL
Drop in the statement you want to tidy, or pick one of six synthetic presets. Nothing you paste is sent anywhere.
- 02Choose a dialect and options
Pick PostgreSQL, MySQL or SQLite, then set keyword case, indentation and comma placement. The output updates as you type.
- 03Read the diagnostics
Select a diagnostic to jump to its line, check columns, keys and indexes in the DDL summary, then download .sql, .md or .json.
What is in the workbench
Dialect-aware formatter
Upper, lower or untouched keywords, two or four spaces or a tab, and commas at the end of a line or in front of it. Comments, semicolons and string literals are preserved.
Minify
Keeps the same tokens and drops whitespace and comments, for a one-line statement in a log or a query sent over the wire.
Syntax diagnostics
An unterminated bracket, quote or block comment is reported first. Once the syntax is broken the other findings are less reliable, so it is shown at the top.
Index-defeating patterns
Conditions that wrap a column such as
LIKE '%…',LOWER(col) = …orcol + 1 = …, implicit casts, chains ofOR, and the NULL trap inNOT INare all reported.DDL summary
CREATE TABLEandCREATE INDEXare parsed into a table of columns, types, NULL, defaults, PK, FK, UNIQUE, CHECK and indexes, with warnings when a foreign key has no index or a table carries too many.Report export
The formatted statement, diagnostics and DDL summary become Markdown and JSON, and the SQL itself can be downloaded. The report never contains the input text.
Why the input never leaves
SQL carries table names you have not published, internal identifiers and the column shapes of live data. This tool is built so none of that is sent anywhere.
Calculated in the page
The tokenizer, formatter, linter and DDL parser are JavaScript inside the page. There is no server call, no database and no analytics payload.
Separate from ads
Advertising and affiliate widgets load from their own origins and never read the input. Results stay in the text area and on the screen.
Nothing kept
Input and results are not stored. Closing the tab clears them and only a file you downloaded yourself remains.
Questions
Does it really check three dialects?
Formatting and rules follow the dialect. :: casts, ILIKE and backtick identifiers pass only for PostgreSQL, AUTO_INCREMENT only for MySQL, AUTOINCREMENT only for SQLite, and LIMIT 10, 20 is marked MySQL-only.
Can formatting change what the statement does?
No. The formatter keeps the token order and only re-lays-out whitespace. Spaces inside strings, comments and the number of semicolons stay exactly as they were.
Why warn about SELECT *?
It moves more data than reading the columns you need and makes a covering index hard to use. It also breaks clients when a column is added or renamed.
Is a leading wildcard always wrong?
LIKE '%value' cannot narrow a B-tree range, so the scan is full. The warning asks whether a full-text index, a reversed index or a prefix search would do.
What does the DDL summary check?
Columns and types per table, NULL and defaults, PK, FK, UNIQUE and CHECK, plus CREATE INDEX and inline indexes. A foreign key without an index slows joins and parent deletes, so it is warned about.
Does it rewrite my SQL?
No. Only the layout changes; diagnostics name the line and the direction a fix should take for the chosen dialect. Keeping the original text is safer to review.
Guides
All guidesFive articles: formatting rules, dialect differences, conditions that defeat an index, a DDL review, and dangerous write statements.
Format a statement now
A synthetic example is already loaded. Paste your own query and it still never leaves the browser.