HTML to Markdown Converter CLI
Convert any HTML to clean Markdown.
Web pages. Docs. Articles. Clean output.
Quick Start
bash
npm install -g @lxgicstudios/markdownify
bash
# Convert HTML file markdownify page.html -o page.md # Convert from URL markdownify https://example.com/article -o article.md # Convert clipboard pbpaste | markdownify
What It Handles
Preserves
- •Headings (H1-H6)
- •Lists (ordered, unordered, nested)
- •Code blocks with language
- •Tables
- •Images with alt text
- •Links
Cleans
- •Removes scripts/styles
- •Strips empty elements
- •Normalizes whitespace
- •Fixes encoding
Commands
bash
# Basic conversion markdownify input.html # From URL with article extraction markdownify https://blog.com/post --article # Batch convert directory markdownify ./html/*.html -o ./markdown/ # Preserve specific elements markdownify page.html --keep-classes # GitHub Flavored Markdown markdownify page.html --gfm # Include images as data URIs markdownify page.html --inline-images # Extract main content only markdownify https://news.site/article --readability
Piping Support
bash
# From curl curl https://example.com | markdownify > page.md # Chain with other tools markdownify page.html | grep -A5 "## Features"
Use Cases
- •Documentation conversion
- •Blog migration
- •Content archival
- •Note-taking from web
- •CMS migration
Built by LXGIC Studios