SQL comment remover
Strip -- line comments and /* */ block comments from SQL without touching string literals.
Related tools
SQL comment remover
Paste an SQL script and this tool strips the comments out: -- line comments to the end of the line and /* */ block comments wherever they appear, including blocks that span several lines. Use it to clean up a schema dump before sharing it, shrink a migration before committing it, or remove internal notes from a query you are about to send to a client or paste into a ticket.
Unlike a naive find-and-replace, the tool actually tokenizes the SQL. Single-quoted strings (including the doubled '' escape), double-quoted identifiers and MySQL backtick identifiers are copied through untouched, so a value like '-- not a comment' or a column named "a--b" survives exactly as written. The remove selector limits the cleanup to line comments only or block comments only when you need just one kind gone.
Two options control the details. Keep marked comments preserves any comment that starts with a marker — with the default ! that means --! annotations and MySQL executable hints like /*!40101 ... */ stay in place, which matters when a dump relies on them. Drop emptied lines removes lines that held nothing but a comment, so a heavily annotated script does not turn into a ladder of blank lines; existing blank lines are always kept.
Everything runs locally in your browser — your SQL is never uploaded, so schemas, table names and data in string literals stay on your machine. The tally under the output shows how many comments were removed and how many bytes you saved.