Free online comment remover

Remove comments
from code, instantly.

Paste your code, hit one button, copy clean output. The free, browser-based comment remover for JavaScript, Python, Rust, Go, and 50+ more languages. No signup, no upload, your code never leaves your browser.

Free forever, no signupRuns in your browserOne click, instant resultREST API + npm package
main.py
#!/usr/bin/env python3
"""Data processing module."""

import pandas as pd  # Data manipulation

# Configuration constants
MAX_ROWS = 10000  # Maximum rows
CHUNK_SIZE = 500   # Batch size

def process_data(filepath):
    """Load and clean the dataset."""
    # Read the CSV file
    df = pd.read_csv(filepath)

    # Remove duplicates
    df = df.drop_duplicates()

    # Filter invalid rows
    df = df[df["status"] != "invalid"]

    # Normalize
    df["name"] = df["name"].str.strip()
    df["email"] = df["email"].str.lower()  # lowercase

    return df  # Return cleaned data
main.py (uncommented)
#!/usr/bin/env python3
"""Data processing module."""

import pandas as pd

MAX_ROWS = 10000
CHUNK_SIZE = 500

def process_data(filepath):
    """Load and clean the dataset."""
    df = pd.read_csv(filepath)

    df = df.drop_duplicates()

    df = df[df["status"] != "invalid"]

    df["name"] = df["name"].str.strip()
    df["email"] = df["email"].str.lower()

    return df
// before// after

Built different.

Not another regex-based comment stripper. Real parsing, real results.

Context-Aware Parser

State-machine parser that understands strings, regex, and nested syntax. Not naive regex.

50+ Languages

JavaScript, Python, Rust, Go, C++, Swift, Kotlin, and many more with language-specific rules.

Bulk Processing

Upload ZIP archives with mixed-language files. Process everything at once, download as ZIP.

Instant

All processing runs client-side in your browser. No upload delay, no server queue.

Preserves Structure

Keeps shebangs, docstrings, strings with comment-like syntax, and TODO comments intact.

Zero Data Collection

Your code never leaves your device. No analytics, no cookies, no tracking. Period.

Three steps. That's it.

No sign-up, no configuration, no waiting.

01

Paste or Upload

Paste code directly into the editor, drag and drop files, or upload entire ZIP archives.

02

Process

Our state-machine parser strips comments while preserving strings, regex, docstrings, and shebangs.

03

Download

Copy clean code to clipboard or download processed files individually or as a ZIP.

0+
Languages
0%
Client-Side
0 bytes
Data Stored
$0
Cost

55+ languages.

If it has comments, we can strip them. Click any language for a tailored guide with examples and FAQs.

JavaScriptTypeScriptPythonJavaCC++C#GoRustRubyPHPSwiftKotlinScalaRPerlLuaShellPowerShellSQLHTMLCSSSCSSYAMLTOMLXMLHaskellElixirDartObjective-CMATLABJuliaGroovyClojureF#VB.NETAssemblyZigNimOCamlErlangFortranLispPrologCOBOLPascalAdaCoffeeScriptVCrystalSolidityJavaScriptTypeScriptPythonJavaCC++C#GoRustRubyPHPSwiftKotlinScalaRPerlLuaShellPowerShellSQLHTMLCSSSCSSYAMLTOMLXMLHaskellElixirDartObjective-CMATLABJuliaGroovyClojureF#VB.NETAssemblyZigNimOCamlErlangFortranLispPrologCOBOLPascalAdaCoffeeScriptVCrystalSolidity
SolidityCrystalVCoffeeScriptAdaPascalCOBOLPrologLispFortranErlangOCamlNimZigAssemblyVB.NETF#ClojureGroovyJuliaMATLABObjective-CDartElixirHaskellXMLTOMLYAMLSCSSCSSHTMLSQLPowerShellShellLuaPerlRScalaKotlinSwiftPHPRubyRustGoC#C++CJavaPythonTypeScriptJavaScriptSolidityCrystalVCoffeeScriptAdaPascalCOBOLPrologLispFortranErlangOCamlNimZigAssemblyVB.NETF#ClojureGroovyJuliaMATLABObjective-CDartElixirHaskellXMLTOMLYAMLSCSSCSSHTMLSQLPowerShellShellLuaPerlRScalaKotlinSwiftPHPRubyRustGoC#C++CJavaPythonTypeScriptJavaScript
Further reading

Dig deeper.

Uncommenter is part of a broader toolset. The same context-aware engine is exposed in our browser tool, our REST API and command-line interface, and an open-source npm package. We document the parser internals and language-specific gotchas on the engineering blog, and you can read about the project's privacy stance on the about page.

Background reading on the languages we parse

Comment syntax varies wildly across languages. Most of the edge cases we handle come straight from official references: JavaScript template literals and regex literals are documented at MDN's template literals reference and MDN's regular expressions guide. Python docstrings follow PEP 257. Rust supports nested block comments by spec, as do Swift and Haskell. The npm package ships the same character-by-character state machine that powers this site, with full TypeScript types and zero runtime dependencies.

See the API documentation for the public /api/v1/uncomment endpoint, the /api/v1/detect language detector, and the cached /api/v1/languages metadata feed.

Frequently asked

Questions, answered.

Uncommenter is a free, browser-based tool that strips comments from source code in 55+ programming languages. It uses a context-aware state-machine parser that preserves strings, regex literals, template literals, raw strings, docstrings, and nested block comments, so your code keeps working after the comments are gone.

55+ languages including JavaScript, TypeScript, Python, Java, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Scala, R, Perl, Lua, Shell, PowerShell, SQL, HTML, CSS, SCSS, YAML, TOML, XML, Haskell, Elixir, Dart, Objective-C, MATLAB, Julia, Groovy, Clojure, F#, VB.NET, Assembly, Zig, Nim, OCaml, Erlang, Fortran, Lisp, Prolog, COBOL, Pascal, Ada, CoffeeScript, V, Crystal, Solidity, Terraform, Dockerfile, Makefile, and more.

No. The web tool runs entirely in your browser using client-side JavaScript. Your code never leaves your device. There are no servers, no databases, no analytics, and no cookies involved in the comment removal process.

Regex-based tools break on edge cases, strings containing comment-like syntax, escaped quotes, template literals, regex literals, raw strings, and nested block comments. Uncommenter walks the source character-by-character with a parser that tracks context, so it correctly distinguishes 'real' comments from comment-like sequences inside string and regex contexts.

Yes. The same engine is available as a public REST API at /api/v1/uncomment, /api/v1/detect, and /api/v1/languages, as well as a zero-dependency npm package (`npm install uncommenter`) and a CLI binary (`uncommenter`) that supports files, directories, stdin, diff, and dry-run modes.

Yes, these are configurable. By default, Python and Elixir docstrings are preserved, shebangs (#!/...) are kept, and TODO/FIXME/HACK/XXX/BUG/NOTE comments are removed along with the rest. You can flip any of those via the options panel in the tool, the API request body, or CLI flags.

Ready to clean
your code?

Free forever. No sign-up. No data collection. Just paste and go.