SQL Minifier

Remove whitespace, line breaks, and comments from SQL to reduce its size.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

What is SQL Minifier?

SQL Minifier removes unnecessary whitespace, line breaks, indentation, and comments from SQL queries to reduce their size. Content inside string literals and quoted identifiers is protected, so compression is safe. Useful for reducing the size of SQL embedded in applications or simplifying log output.

How to Use

  1. Paste an SQL query into the input field.
  2. Click "Minify" to strip whitespace, line breaks, and comments.
  3. The character count before and after, along with the reduction rate, are displayed.
  4. Click "Copy Result" to copy to clipboard.

FAQ

Is whitespace inside string literals removed too?

No. Content inside single-quoted, double-quoted, and backtick-quoted strings or identifiers is protected and left unchanged.

Are comments removed?

Enable the "Remove comments" option to strip both "--" line comments and "/* */" block comments.

Is all spacing between keywords removed?

With "Keep single space between keywords" enabled, minimal readability is preserved (e.g. SELECT id FROM users). Disabling it compresses spacing as much as possible.

Is my data sent to a server?

No. All processing happens in your browser.