Skip to content

SQL Minifier

Compress SQL onto one line by removing comments and extra whitespace, without touching string literals.

Runs in your browserSQL → SQL
Loading tool…

Example

Input
SELECT id, name -- user name
FROM users
WHERE note = 'a  --  b' /* filter */
  AND id IN (1, 2);
Output
SELECT id,name FROM users WHERE note = 'a  --  b' AND id IN(1,2);

How to use the SQL Minifier

  1. Paste or type your SQL into the input area, or open a file from your device.
  2. Adjust the options above the editor if the tool offers any.
  3. Review the SQL result, then copy it or download it as a file.

Privacy and limitations

  • Your data is processed on your device and is not uploaded to any server.
  • MySQL /*! ... */ and optimizer /*+ ... */ hint comments are kept; all other comments are removed.

Browse all sql converters →