SQL Minifier

Put an SQL query on one line without comments.

SQL Minifier

.sql

Paste text or open a file to see the result.

What it does

Puts an SQL query on a single line and removes its comments. Useful when you need to paste a query into code, a config value or a command line where line breaks get in the way. The query does the same thing.

About the .sql format

.SQL file extension
File Type
Structured Query Language Data File
MIME
application/sql

SQL is a database query and data manipulation language. The .SQL extension refers to a file that stores SQL commands in a text file.

SQL Minifier questions

How do I use the SQL Minifier?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .sql change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .sql page lists programs and converters for it.