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/tap/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

Apple Silicon and Intel Macs, Linux (Linuxbrew), Windows via WSL. Same flags everywhere.

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/tap/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. It runs anywhere Node.js runs — Apple Silicon, Intel Macs, Linux (Linuxbrew) and Windows under WSL. The formula installs the source and uses your local Node.

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 →