MACOS · LINUX · WSL

The HTML-to-Markdown CLI you can
brew install

Clean Copy converts messy HTML into clean Markdown, CSV, WikiLinks or plain text — straight from your terminal. Free, open source, no account.

Install

brew install mahope/clean-copy/clean-copy

Prefer npm? npm install -g github:mahope/clean-copy-cli does the same thing. Binaries are also on the releases page.

Try it in ten seconds

$ echo '<h1>Hello</h1><p>Some <b>bold</b> text</p>' | clean-copy
# Hello
# Some **bold** text

$ curl -s https://example.com | clean-copy -m csv   # tables → CSV
$ pbpaste | clean-copy                              # clipboard → Markdown

Four output modes

Markdown (default), CSV with RFC 4180 escaping, Obsidian WikiLinks (-w) and plain text (-m text). Switch with one flag.

Built for pipes

Reads stdin or -i file, writes stdout or -o file. Drops into shell scripts, cron and GitHub Actions without glue code.

Smart cleanup built in

-s fixes smart quotes, em-dashes and non-breaking spaces — the junk that breaks linters and diffing.

Works everywhere

Native arm64 + x86_64 macOS builds, Linuxbrew, Windows via WSL. Same flags on every platform.

Full flag reference

Every mode, flag and example lives on the one-page CLI reference card. Want to convert web pages instead of files? Try the free browser-based tool — no install at all.

Frequently asked questions

How do I install Clean Copy with Homebrew?

Run: brew install mahope/clean-copy/clean-copy. That adds the tap, downloads the formula and puts the clean-copy command on your PATH. Verify with clean-copy --version.

Does it work on Apple Silicon?

Yes. The formula ships native arm64 binaries as well as Intel builds, so it runs fast on both M-series Macs and older Intel machines. It also works on Linux via Linuxbrew and on Windows under WSL.

Is it really free?

Yes — the CLI core is open source (MIT). You can convert HTML to Markdown, CSV, WikiLinks or plain text as much as you like. No account, no telemetry.

Can I use it in scripts and CI?

Yes. Clean Copy reads stdin or a file and writes stdout or a file, so it drops straight into pipes, cron jobs and GitHub Actions. There is also an official GitHub Action: mahope/clean-copy-cli@v1.

View source on GitHub →