Beautifier · Auto-commenter · Optimizer

Beautify, comment, and optimize SQL in one place.

SQL Script is a free browser-based workspace for developers, analysts, and DBAs: beautify dense queries, add plain-English auto-comments, and run safe structural optimizations—without sending your SQL to a server.

SELECT
  customer_id,
  COUNT(*) AS orders,
  SUM(total) AS revenue
FROM orders
WHERE created_at >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY customer_id
ORDER BY revenue DESC;

Beautifier

Readable SQL in seconds

Normalize indentation, keyword case, commas, and line breaks across 20+ dialects so queries are easier to review in PRs, migrations, and notebooks.

Auto-commenter

Plain-English explanations

Turn beautified SQL into an auto-commented script with clause-level notes that help teammates understand joins, filters, grouping, and ordering faster.

Optimizer

Safe structural rewrites

Apply browser-based query cleanup—inline pass-through subqueries, push filters, and remove redundant conditions—then beautify the improved SQL.

20+ dialects Standard SQL, PostgreSQL, MySQL, BigQuery, Snowflake, SQLite, SQL Server, and more.
Private by design Beautifying, auto-comments, and optimization run in the browser—your SQL stays on your device.
Review ready Consistent style, explanation comments, and rewrite summaries make pull requests easier to scan.
One workflow Optimize, beautify, comment, copy, or download without switching between separate tools.

Beautifier · Auto-commenter · Optimizer

SQL beautifier, auto-commenter & optimizer

Paste SQL and choose a dialect. Beautify for readability, turn on auto-comments for plain-English explanations, or run Optimize for safe structural rewrites—all in your browser.

Runs in your browser
Ready to beautify SQL.626 chars in / 694 chars out / 42 lines

Three tools, one page

Beautifier, auto-commenter, and optimizer.

SQL beautifier

Choose the dialect that matches your database, then apply indentation, keyword casing, comma placement, and logical-operator line breaks your team expects.

SQL auto-commenter

Generate plain-English explanation comments across the query so pull requests, tickets, runbooks, and docs capture intent—not just syntax.

SQL optimizer

Run safe structural rewrites in the browser, see what changed, and get beautified output ready to paste into your repo or warehouse console.

20+ SQL dialects

PostgreSQL, MySQL, SQLite, BigQuery, Snowflake, SQL Server, Spark, and standard SQL—with dialect-aware parsing for comments and optimization.

Copy and download

Export review-ready scripts to clipboard or .sql files after beautifying, commenting, or optimizing.

Private by default

Beautifying, commenting, and optimization execute locally. Follow your org policy for sensitive production SQL regardless.

SQL formatting guide

How to write readable SQL.

Start each clause on a new line

Separating SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY helps readers find the query structure.

Indent nested logic

Indentation makes subqueries, CTEs, CASE statements, and join predicates easier to reason about.

Keep aliases meaningful

Short aliases are useful, but descriptive names reduce confusion in queries that join several tables.

From the blog

Guides for cleaner SQL.

Frequently asked questions

SQL Script FAQ.

What is SQL Script?

SQL Script is a free browser tool that combines a SQL beautifier, a plain-English auto-commenter, and a structural SQL optimizer for review-ready queries.

Does beautifying or optimizing change results?

Beautifying changes presentation only. The optimizer applies conservative rewrites intended to preserve semantics; always review output before running against production data.

How does auto-commenting work?

After beautifying, optional comments describe clauses such as SELECT lists, joins, filters, grouping, and ordering—generated locally from the parsed query structure.

What does the optimizer rewrite?

Common passes include inlining pass-through subqueries, pushing filters into inner scopes, and removing always-true conditions—with a plain-language summary of each change.

Which databases are supported?

Choose from 20+ dialects including PostgreSQL, MySQL, SQLite, BigQuery, Snowflake, and SQL Server so keywords and syntax stay aligned with your target engine.

Can I use this with sensitive SQL?

Processing runs in your browser, but follow your organization's policy for confidential production queries and credentials.