Free · Private · In-Browser

Comment Stripper

Strip common line and block comments from pasted code snippets.

Output
 

Strip comments from a snippet

When you want to share clean code, count real lines, or paste a config without its explanatory noise, the comments get in the way. This stripper removes common line and block comments from a pasted snippet, leaving just the code.

It handles the usual comment styles so you can quickly clean JavaScript, CSS, or config before sharing or measuring it. Paste the snippet, get the comment-free version, and copy it — the original stays untouched in the input.

Clean code, kept local

Stripping comments is useful for counting real lines or sharing a config without its notes, but keep an original since removed comments are gone. It runs in your browser.

Frequently asked questions

Which comments does it remove?

In JavaScript and CSS mode, block comments like /* ... */ and whole lines starting with //. In hash mode, whole lines starting with #.

Does it remove comments after code on the same line?

No, it keeps any line that starts with code. That avoids breaking URLs and strings that happen to contain //.

Will stripping comments change how the code runs?

Comments never run, so removing them does not change behavior. Check the result anyway before replacing a file.

Take it further
Developer Tools

Practical utilities for everyday web development work.

Learn more