SQL Comment Remover

Remove line comments (--) and block comments (/* */) from SQL.

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 Comment Remover?

SQL Comment Remover strips “–” style line comments and “/* */” style block comments from SQL queries. Content inside string literals is protected, so only actual comments are removed. Useful for cleaning up SQL before deploying to production or sharing a query without development notes.

How to Use

  1. Paste an SQL query into the input field.
  2. Choose which comment types to remove (line comments, block comments, or both).
  3. Click "Remove" to strip the comments.
  4. Click "Copy Result" to copy to clipboard.

FAQ

Could "--" or "/*" inside string literals be removed by mistake?

No. Content inside single-quoted, double-quoted, and backtick-quoted strings is protected and is never mistaken for a comment.

Can I remove line comments and block comments independently?

Yes. Each type can be toggled on or off independently with its own checkbox.

What happens to blank lines left behind after removing comments?

Enable the "Collapse blank lines" option to merge consecutive blank lines into a single line for cleaner output.

Is my data sent to a server?

No. All processing happens in your browser.