Skip to content

About

Free offline desktop app to remove comments from source code: whole folders, 157 file types (Python, JS/TS, C/C++, C#, Java, Go, Rust, PHP…), multi-core and string-safe. Saves removed comments to one JSON backup for byte-exact restore. Windows, Qt 6.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Comment Killer app icon: a pink comment bubble with two slashes and a remove badge

Comment Killer

Free desktop app to remove comments from source code: whole folders, 150+ file types, all CPU cores

Strip every comment from a project in seconds, and keep a single JSON backup so you can put them all back.
String-aware, regex-aware, byte-exact restore. 100% offline: no cloud, no account, no upload.

Download for Windows Latest release Downloads Discord

Platform Built with Languages License


Comment Killer removing 3,244 comments from 101 source files in 0.1 seconds with a multi-process worker pool

3,244 comments removed from 101 files in a tenth of a second. Every removed comment went into one JSON backup.


Comment Killer is a free desktop tool that removes comments from source code in a single file, a folder or an entire repository. Drop in a project, press Start Processing, and every //, /* */, #, --, <!-- --> and docstring is stripped across 31 language groups / 157 file types using every CPU core. Strings, raw strings, template literals, regex literals and heredocs are never touched. Each run writes one JSON backup of everything it removed, and the Restore page puts the comments back: byte for byte if the file hasn't changed, or by matching the surrounding code if it has. Made by Inbora Studio.

Contents

Why Comment Killer

Comment Killer Typical regex scripts / online strippers
Safety Skips strings, raw strings, template literals, regex literals and heredocs "http://..." and `a // b` get mangled
Undo One JSON backup per run, byte-exact restore Comments are gone for good
Scale Whole repositories, multi-process, about 5,000 files/s One file at a time, or single-threaded
Privacy Runs locally, code never leaves your PC Code is pasted into a website
Languages 31 groups / 157 file types in one tool Usually one language per tool
Formatting Keeps line endings, encodings, BOMs, indentation Leaves blank lines and trailing spaces
Smart keeps Keeps #!, eslint, noqa, @ts-ignore, #region, license headers Deletes tool directives and breaks builds

Useful for shipping minimal source, preparing code for LLM context windows (fewer tokens), code obfuscation prep, teaching / exam handouts, clean diffs, open-sourcing internal code after removing internal notes, and measuring code without comments.

Download

Platform File Notes
Windows 10 / 11 (64-bit) CommentKiller-Windows-<version>-portable.zip Unzip anywhere and run CommentKiller.exe. Fastest start-up.
Windows (single file) CommentKiller-<version>.exe One portable .exe, no install.
macOS / Linux Run from source Needs Python 3.10+ and PySide6.

Nothing else to install. Release builds bundle Python, Qt and every library. Release files are built automatically by GitHub Actions from this repository, with a SHA256SUMS.txt for verification.

How to remove all comments from a project in 3 steps

  1. Open Comment Killer and drag your project folder onto the window (or use Add Folder / Add Files). Subfolders are scanned; node_modules, .git, venv, build, dist, target, __pycache__ and others are skipped automatically.
  2. Check Settings (optional): choose languages, which comments to keep, in-place or copy-to-folder output, and whether Python docstrings should go too. Double-click any file to preview exactly what will be removed.
  3. Press Start Processing. Comments are removed on all CPU cores and saved to Documents\Comment Killer Backups\<project>_<date>.json. To undo, open Restore, pick the backup and press Restore Comments.

Features

Removal engine

  • 31 language groups / 157 file types: C, C++, C#, Java, Kotlin, Swift, Dart, JavaScript, TypeScript, Go, Rust, PHP, Python, Ruby, Shell, PowerShell, SQL, Lua, HTML/XML/Vue/Svelte, CSS/SCSS/LESS, YAML/TOML/INI, Haskell, Julia, Perl, Batch, Visual Basic, Lisp/Clojure, LaTeX/Erlang and more
  • String- and syntax-aware: never touches comment markers inside strings, raw strings (R"(...)", r#"..."#, @"..."), template literals, JS regex literals, Python triple-quoted strings, shell heredocs or Lua long strings
  • Clean output: whole-line comments are removed with their line, trailing comments with the spaces before them, int/*x*/a becomes int a (tokens are never glued together)
  • Keeps what matters: shebangs, encoding lines, eslint, noqa, @ts-ignore, pylint:, go:build, #region, /*!, @license, NOLINT, prettier-ignore and an editable list of your own patterns, plus license headers at the top of files
  • Optional Python docstring removal, which inserts pass where a body would otherwise be empty so the code still compiles
  • Preserves files exactly: CRLF/LF line endings, UTF-8 / Latin-1 encodings and BOMs; binary files are skipped; writes are atomic

Speed

  • Multi-process worker pool uses every CPU core (switch to a thread pool if you prefer)
  • 2,865 files / 116,267 comments in 0.54 s on a 24-thread desktop CPU (about 5,300 files per second)
  • Scans huge repositories in the background; the queue table handles tens of thousands of rows

Backup and restore

  • One JSON file per run with every removed comment, written during the run so a crash still leaves a recoverable backup
  • Byte-exact restore for unchanged files (verified by hash)
  • Smart restore for files edited after stripping: comments go back where the surrounding code still matches, and anything that can't be placed is reported
  • Restore into any folder, so it works even if the project has moved
  • Verify-only mode checks a restore without writing anything

Desktop app

  • Clean dark interface with pink highlights, live CPU / RAM meters and a per-file results table
  • Before / after preview with removed parts highlighted
  • Dry run, copy to output folder or edit in place (with a confirmation that shows where the backup will go)
  • Settings are saved automatically

Screenshots

Comment Killer source queue: drag and drop source files and project folders
Source queue: drop files or whole repositories.
Comment Killer settings: enable languages and choose which comments to keep
Settings: languages, keep-rules, output, backup and performance.
Before and after preview of removed JavaScript comments, strings and regex literals untouched
Preview: see exactly what will be removed before you run.
Restore page: put removed comments back from the JSON backup
Restore: put every comment back from the JSON backup.

What it does to a file (JavaScript example):

// Fetch the user
const url = 'http://api.example.com'; // base URL
const re = /\/\//g;  /* matches "//" */
let s = `keep // this ${x}`;
// eslint-disable-next-line
foo(/* inline */ 1);

becomes

const url = 'http://api.example.com';
const re = /\/\//g;
let s = `keep // this ${x}`;
// eslint-disable-next-line
foo(1);

Supported languages

Group Extensions / files Comment styles removed
C / Objective-C .c .h .m .mm // /* */
C++ / CUDA .cpp .cc .cxx .hpp .hh .ino .cu .cuh … // /* */ (raw strings safe)
C# .cs .csx // /* */ (verbatim & raw strings safe)
Java / Kotlin / Scala / Groovy / Swift .java .kt .kts .scala .groovy .gradle .swift // /* */ (text blocks safe)
JavaScript / TypeScript .js .jsx .mjs .cjs .ts .tsx .mts .cts .jsonc .json5 // /* */ (template & regex literals safe)
Go / Rust / Zig / Dart .go .rs .zig .dart // /* */
Shaders / Proto / Solidity .glsl .hlsl .wgsl .shader .proto .sol … // /* */
PHP / Terraform .php .tf .tfvars .hcl // /* */ #
CSS / SCSS / LESS / Sass .css .scss .less .sass .styl /* */ (// in preprocessors)
Python .py .pyw .pyi .pyx .gd #, optional docstrings
Shell / Dockerfile / PowerShell .sh .bash .zsh .fish Dockerfile .ps1 .psm1 # <# #> (heredocs safe)
Ruby / Perl .rb .rake Gemfile .pl .pm # =begin/=end POD
YAML / TOML / R / Make / CMake / Elixir / Nim .yaml .yml .toml .r Makefile CMakeLists.txt .ex .nim … #
INI / Properties .ini .cfg .properties .editorconfig ; #
SQL .sql .psql .pgsql -- /* */ ($$ bodies safe)
Lua / Haskell / Elm / Julia .lua .hs .elm .jl -- --[[ ]] {- -} #=
HTML / XML / Vue / Svelte / SVG / XAML .html .xml .vue .svelte .svg .xaml .csproj … <!-- -->
Batch / Visual Basic .bat .cmd .vb .vbs .bas REM :: '
Lisp / Clojure / Assembly / LaTeX / Erlang .lisp .clj .el .asm .tex .erl … ; %

Hover a language in Settings → Languages to see its full extension list.

Backup and restore

Every run writes one JSON file (default folder: Documents\Comment Killer Backups):

{
  "format": "comment-killer-backup", "version": 1,
  "created": "2026-12-03T23:53:36", "root": "C:/projects/my-app",
  "files": [
    { "path": "src/app.js", "lang": "js", "enc": "utf-8", "bom": false,
      "hash": "…", "orig_hash": "…",
      "comments": [ { "o": 0, "t": "// Fetch the user\n", "b": "", "a": "const url = 'http…" } ] }
  ],
  "summary": { "files": 101, "comments": 3244 }
}
  • o is the position in the stripped file, t is the exact removed text (including the whitespace and newline that went with it), and r is any replacement text such as pass or a single space.
  • b / a are short snippets of code before and after each comment. If the file was edited after stripping, these are used to find where each comment belongs.
  • If the hash of the current file equals hash, restore is byte-exact. If it equals orig_hash, the file already has its comments and is left alone.

FAQ

How do I remove all comments from my code?

Open Comment Killer, drag your project folder in and press Start Processing. Every supported file in the folder and its subfolders has its comments removed, and a JSON backup of the removed comments is saved so you can restore them later.

Can I get my comments back after removing them?

Yes. Open Restore, choose the backup from the list (or Open Backup File), pick the folder and press Restore Comments. Files you haven't touched come back byte for byte. Files you edited afterwards get their comments back wherever the surrounding code still matches, and the results table reports anything that couldn't be placed.

Will it break strings that contain // or #?

No. Each language has a scanner that recognises string literals, raw strings, template literals, regex literals, heredocs and long strings, and skips them. A URL like "http://example.com" or a shell $# is left alone.

Does it keep eslint-disable, # noqa, @ts-ignore and the shebang line?

Yes, by default. Preserve directive comments keeps comments that contain any pattern in an editable list (eslint, noqa, @ts-, pylint:, go:build, #region, @license, NOLINT, prettier-ignore and more). The #! line and top-of-file license headers are kept too. Each of these can be turned off.

Can it remove Python docstrings?

Yes. Turn on Remove Python docstrings. If a function or class body would end up empty, Comment Killer inserts pass so the file still compiles.

Is it safe to run on a real repository?

It was built to be: writes are atomic (temporary file + rename), a confirmation dialog shows the backup location before in-place edits, Dry run and copy to output folder modes write nothing to your sources, and the backup lets you undo. Committing to git first is still a good habit.

How fast is it?

It runs a process pool across all CPU cores. On a 24-thread desktop CPU it processed the whole Python standard library (2,865 files, 116,267 comments) in 0.54 seconds.

Why remove comments at all?

Common reasons: shrinking code before pasting it into ChatGPT, Claude or another LLM (fewer tokens), shipping or publishing source without internal notes, preparing exam or teaching material, getting cleaner diffs, measuring code size without comments, and preparing code for minification or obfuscation.

Does it upload my code anywhere?

No. Everything runs locally. There is no network access, telemetry or account.

Which encodings and line endings are supported?

UTF-8 (with or without BOM) and anything else is read losslessly as Latin-1. CRLF and LF line endings are preserved exactly. Files containing NUL bytes are treated as binary and skipped.

Windows SmartScreen warns about the download. Is it safe?

New, unsigned apps can trigger SmartScreen until they build up reputation. Click More info → Run anyway, verify the file against SHA256SUMS.txt on the release page, or run it from source.

Where are settings and backups stored?

Settings are saved automatically (Windows registry under HKCU\Software\CommentKiller\CommentKiller). Backups go to Documents\Comment Killer Backups by default; change this in Settings → Comment backup.

How it works

flowchart LR
    A[Files / folders] -->|background scan| B[Queue]
    B -->|process pool<br/>all CPU cores| C[Per-language scanner<br/>one compiled regex]
    C -->|skip strings, raw strings,<br/>regex literals, heredocs| D[Comment spans]
    D --> E[Stripped file<br/>atomic write]
    D -->|offset + text + context| F[(JSON backup)]
    F -->|exact or matched| G[Restore]
Loading
  • Scanner: each language profile compiles one regular expression whose alternatives match either a comment or a "skip" token (string, raw string, template literal, regex literal, heredoc …). re.finditer does the scanning in C, which is where the speed comes from.
  • Whitespace handling: spans are extended over the indentation, trailing spaces and newline they leave behind, and adjacent comments are merged, so the output has no stray blank lines.
  • Backup: every removed span is stored as (offset in stripped file, removed text, replacement, context). Re-inserting the spans in reverse order rebuilds the original file exactly.
  • Parallelism: files are split into adaptive batches and sent to a ProcessPoolExecutor. Small jobs (under 150 files) use threads to avoid process start-up cost.
  • App: Python + Qt 6 (PySide6) with a custom dark theme; the engine (engine.py) has no Qt dependency and can be used on its own.

Use the engine from Python

from comment_killer import engine

opts = engine.StripOptions(remove_docstrings=False)
stripped, entries = engine.strip_text(source_text, "python", opts)
original, exact, placed, failed = engine.restore_text(stripped, entries, engine.text_hash(stripped))
assert original == source_text

Run from source

Requires Python 3.10+.

git clone https://github.com/InboraStudio/Comment-Killer.git
cd Comment-Killer
pip install -r requirements.txt
python main.py                    # or double-click run.bat on Windows
python main.py C:\path\to\project # start with a folder already queued

Run the tests:

python -m unittest discover -s tests -v

Build the Windows app yourself (PyInstaller):

build_exe.bat

The result is dist\CommentKiller\CommentKiller.exe. The app icon is generated by python tools/make_icon.py.

Making a release

Push a version tag and GitHub Actions (release.yml) builds the portable zip and the single-file .exe, writes SHA256SUMS.txt and attaches them to the release:

git tag v1.0.1
git push origin v1.0.1

Changelog

Latest: v1.0.0: first public release. Multi-language comment removal, process-pool speed, JSON backup with byte-exact and context-matched restore, before/after preview, and a dark Qt UI. See CHANGELOG.md.

Roadmap

  • 31 language groups, string- and regex-aware scanning
  • Multi-process engine with live progress
  • Single-file JSON backup with byte-exact and context-matched restore
  • Before / after preview, dry run, copy-to-folder output
  • Command-line interface for CI pipelines
  • Remove comments inside <script> / <style> blocks of HTML and Vue files
  • Git-aware mode (only changed files, respect .gitignore)
  • macOS and Linux release builds

Have an idea? Open an issue or tell us on Discord.

Community and support

  • Discord: discord.gg/pVA8NZ5mru: help, feedback and new releases
  • Bugs and feature requests: GitHub Issues
  • Like the project? Star the repo. It helps other developers find a safe, free comment remover.

Credits

Made by Inbora Studio (Dr Chamyoung).

Built with Python, Qt for Python (PySide6) and psutil. Released under the MIT License.

Comment Killer · remove comments from code · comment remover · strip comments from source code · delete comments in bulk · Python, JavaScript, TypeScript, C, C++, C#, Java, Go, Rust, PHP comment stripper · reduce LLM tokens · free offline Windows desktop app

About

Free offline desktop app to remove comments from source code: whole folders, 157 file types (Python, JS/TS, C/C++, C#, Java, Go, Rust, PHP…), multi-core and string-safe. Saves removed comments to one JSON backup for byte-exact restore. Windows, Qt 6.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages