You are already in the shell — why open a browser tab to convert a page? Pipe curl output, dump documentation, feed CI reports: one zero-dependency CLI turns any HTML into clean Markdown without leaving the keyboard.
Updated August 2026 · 5 minute read
Web-based converters break the moment your input is not a public page: internal wikis, authenticated dashboards, files on disk, gigabyte logs. And copy-pasting through a browser tab does not belong in a script.
A CLI composes with everything else you already use — curl, pandoc, git hooks, cron jobs, GitHub Actions. No browser automation needed.
Paste an NDA draft or an internal runbook into an online converter and you have sent it somewhere else. A local CLI keeps every byte on disk.
npm install -g pulls hundreds of packages with most converters. A single-file, dependency-free tool installs in seconds and stays auditable.
| Option | What it does | Catch |
|---|---|---|
| Online converters | Paste HTML in a form, copy Markdown back | Manual, uploads your text, no scripting |
| Pandoc | Universal document converter, excellent Markdown out | Large binary; treats pages as documents, not as web content |
| npm html-to-md packages | Library you call from Node | You have to write the script yourself each time |
| Clean Copy CLI | One command: file, URL or stdin → clean Markdown or plain text | Requires Node 16+ (no other dependencies) |
Clean Copy CLI is the same converter engine behind the Clean Copy browser extension and VS Code extension, packaged as a single-file Node program.
brew tap mahope/clean-copy
brew install clean-copy
# or: download the tarball from GitHub releases and drop clean-copy.js on your PATH
# A file on disk
clean-copy article.html
# A live web page
clean-copy -u https://example.com/blog
# A pipe — this is where it shines
curl -sL https://example.com/docs | clean-copy
# macOS clipboard round-trip: dirty HTML in, clean Markdown out
pbpaste | clean-copy | pbcopy
clean-copy -t email_dump.html # strip all formatting, keep readable text
H1–H6 map to the right number of #, so document structure survives.
Links become standard Markdown references with original URLs.
Simple HTML tables become Markdown pipe tables, alignment included.
There is an official action so CI workflows can convert pages as part of a build.
Install Clean Copy (brew tap mahope/clean-copy && brew install clean-copy, or download the release tarball) and run: clean-copy article.html. For a live page: clean-copy -u https://example.com/blog.
Yes. The tool reads stdin by default: curl -sL https://example.com | clean-copy. On macOS you can chain it with pbcopy to put the result on your clipboard: pbpaste | clean-copy | pbcopy.
Yes. There is an official GitHub Action (clean-copy HTML to Markdown) and the CLI itself has zero npm dependencies, so it runs anywhere Node 16+ runs without a heavy install step.
Headings map to # levels, links become [text](url), lists stay lists, bold and italic survive, code blocks become fenced blocks, and simple tables convert to pipe tables — including alignment. Add -t for plain text instead.
No. The converter is a local Node.js program. Your HTML and URLs never leave your machine, which also makes it safe for internal docs and CI logs.