OneFreePlace · Developer Tools · #344

SQL Minifier

Compress SQL safely with dialect-aware tokenization, semantic comment protection, batch workflows, and a fail-closed token guard — entirely in your browser.

100% freeLocal processingNo uploadSemantic guard
SQL input0 lines · 0 B
1
Minified outputWaiting
1
•
Ready to minifyInput never leaves this device.
Semantic guard—
Idempotency—
Saved—
Time—
Safe default: ordinary comments are removed, but optimizer hints, MySQL/MariaDB executable comments, and license/preserve comments survive. Output is blocked if significant tokens change.
Input bytes—
Output bytes—
Saved—
Tokens—
Comments removed—
Comments kept—
Gzip output—
Statements—

Safety & compression lens

The output is re-tokenized and compared against the expected significant token stream. SQL is never executed by this tool.

Minify SQL to see comment classification, semantic guard results, and execution-review hints.

Readable reconstruction

Useful for reviewing the minified result. Removed comments cannot be reconstructed.

Drop SQL files hereChoose multiple .sql/.txt files. Minification, verification and ZIP creation stay local.

Portable minifier profile

Share the minification rules without sharing SQL. The profile is plain JSON.

Why this is safer than regex minification

Tokenizer firststrings, quoted identifiers, parameters and templates are recognized before whitespace is removed
Comment intelligenceordinary comments differ from optimizer hints and executable vendor comments
Pairwise boundary testspaces disappear only where adjacent tokens cannot merge into a different token
Fail closedthe final output must reproduce the expected token stream or download/copy stays disabled

16 dialect profiles

Standard SQL, PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, BigQuery, Snowflake, SQLite, DuckDB, Redshift, ClickHouse, Spark, Hive, Trino/Presto and DB2.

Semantic comments

Safe mode keeps /*+ hints */, MySQL/MariaDB executable comments such as /*! ... */, and license/preserve comments while stripping ordinary notes.

Literal protection

Single/double/backtick/bracket quotes, PostgreSQL dollar strings, Oracle q-quotes, BigQuery triple strings, parameters and template blocks are tokenized before compaction.

Batch separators

Standalone SQL Server GO and Oracle slash terminators stay on separate lines. MySQL custom DELIMITER, psql meta-commands, SQLCMD directives and SQL*Plus client directives are blocked instead of guessed.

Three spacing modes

Safe Compact is recommended. Readable keeps one-space boundaries. Maximum mode removes every lexically unnecessary space, then still has to pass the semantic guard.

What minification does not do

It does not optimize query plans or make databases execute SQL faster. It reduces transport/storage size and makes SQL easier to embed in config, logs and generated payloads.

Readable reconstruction

After successful minification, generate a formatted review copy locally. This is a convenience view; stripped comments are permanently absent.

Privacy

No account, upload, telemetry or server round trip is required. Files, batch processing, auditing and ZIP creation stay in your browser.