SQL Minifier

Collapse a SQL query to one line and remove comments.

πŸ”’ Runs in your browser⚑ Instant resultsπŸ†“ Free, no sign-up

How to use SQL Minifier

  1. Paste or type your text into the box. If you just want to see how SQL Minifier behaves, press Load example.
  2. Your result appears on the right as you type. There is no convert button to hunt for.
  3. Click Copy result to paste it somewhere else, or Download to save it as a text file. Use result as input lets you run a second conversion on the output.

What is it good for?

Collapse a SQL query to one line and remove comments. It saves you the tedious retyping that comes with doing this by hand.

It works on whatever you paste, line by line where that makes sense, and it handles non-English text properly, because it works with Unicode and not just plain English letters. People most often reach for it when checking what a token or encoded value really contains, reducing file sizes before deploying a website and debugging an API response that came back as one unreadable line.

See it in action

Here is a quick example so you can see what to expect.

You typeSELECT id, name FROM users -- all users WHERE age > 18;
You getSELECT id, name FROM users WHERE age > 18;
Good to know. Handy for putting a query inside code without lots of line breaks.

Tips for better results

It works on the exact text you paste, so check the first few lines of the result before you copy the whole thing. That catches a wrong option early, while it is cheap to fix.

Empty input gives an empty result, which is normal. Paste something, or press the sample button to see how the tool behaves.

You can chain tools. For example, clean up spaces first, then sort or deduplicate. Each step is quick, and you stay in control of what changes.

Privacy

Everything you paste is processed by JavaScript in your own browser. It is not uploaded, logged or stored on our servers, so it is fine for private lists and drafts.

Frequently asked questions

Is SQL Minifier free to use?

Yes, completely free. There is no sign-up, no watermark and no limit on how many times you use it.

Is my data safe when I use SQL Minifier?

Your text is processed in your browser by JavaScript. It is not sent to our servers, so it stays private.

Does SQL Minifier work on my phone?

Yes. The layout adapts to small screens, and the tool works in current versions of Chrome, Edge, Firefox and Safari.

Any tips for using SQL Minifier?

Handy for putting a query inside code without lots of line breaks.