Paste SQL to strip -- line comments and /* */ block comments and collapse all whitespace onto one line. Spaces around commas, parentheses, = and semicolons are removed as well.

The minifier tokenizes the query, so text inside string literals, quoted identifiers ("..." and `...`) and PostgreSQL dollar-quoted bodies ($$...$$) is copied exactly, including anything that looks like a comment. Optimizer hints written as /*+ ... */ and MySQL /*! ... */ comments are preserved.

Turn on Backslash escapes for MySQL strings like 'it\'s', and [bracket] identifiers for SQL Server names that contain spaces. Use this for embedding queries in code or config. For readability, use the SQL formatter instead. Everything runs in your browser.