SQL Comment Remover
Strips line and block comments without disturbing comment characters inside string literals.
Loading the tool…
How to use this tool
- Paste the script containing the comments.
- Select Remove comments.
- Read the result before sharing it — check that nothing sensitive remains in the SQL itself.
What sql comment remover does
Removing comments from SQL sounds like a job for search and replace until you meet a string literal containing two hyphens, or a URL with a double slash inside quotes. This tool tokenises the statement first, so it can tell a real comment from a sequence of characters that merely looks like one.
The common reasons to strip comments are preparing a script for a tool that mishandles them, and removing internal notes before sharing a query outside your team. If the second reason applies, read the result before you send it: comments are not the only place a query can carry something private, since table names, literal values and column names often say a good deal on their own.