A fast, lightweight HTML, PDF, DOCX, and Markdown to Markdown converter optimized for LLM consumption — built by the Nano Collective, a community collective building AI tooling not for profit, but for the community. Everything we build is open, transparent, and driven by the people who use it.
Lightning-fast (<100ms) with optional AI-powered conversion using a local LLM model. Pass in HTML, PDF, DOCX, Markdown files, or a URL and get clean, structured Markdown back — as a library or from the command line.
npm install @nanocollective/get-mdimport { convertToMarkdown } from "@nanocollective/get-md";
const result = await convertToMarkdown("https://example.com");
console.log(result.markdown);Or use the CLI:
npx @nanocollective/get-md https://example.com -o output.md
npx @nanocollective/get-md handbook.pdf -o output.md
npx @nanocollective/get-md document.docx -o output.mdDiagrams are usually the first casualty of an HTML-to-Markdown conversion. get-md handles them four ways — the Diagrams & Mermaid guide covers each in full:
- Preserved — a
```mermaidfence already in your HTML or Markdown comes out unchanged. On by default, no extra dependencies. - Recovered — when a docs site has already rendered a diagram to
<svg>, get-md pulls the original source back out of the DOM. On by default. - Reconstructed — diagrams drawn into a PDF can be rebuilt by a remote vision model. Opt-in, best-effort; needs
pdfjs-distand@napi-rs/canvas. - Validated —
validateMermaid: trueparses every Mermaid block and annotates the ones that fail, keeping the original so you can repair it. Opt-in; needsmermaid.
npm install mermaidconst result = await convertToMarkdown(source, {
inputType: "markdown",
validateMermaid: true,
});Run examples/mermaid-diagrams.ts to see all of it working offline.
Full documentation is available online at docs.nanocollective.org or in the docs/ folder:
- Getting Started — Installation, requirements, and your first conversion
- API Reference — Full reference for the library API
- CLI — Command-line interface usage and options
- Guides — LLM-powered conversion, Mermaid diagrams, React Native, and configuration tips
- Configuration — Config files and options reference
- Community — Contributing, Discord, and how to help
The Nano Collective is a community collective building AI tooling for the community, not for profit. We'd love your help.
- Contribute: See CONTRIBUTING.md for development setup and guidelines.
- The collective: nanocollective.org · docs · GitHub · Discord
- Support the work: The Support page covers donations and sponsorship.
- Paid contribution: The Economics Charter sets out how scoped paid bounties work.