@markdown-for-agents/audit
Audit token savings when converting HTML to Markdown with markdown-for-agents — a runtime-agnostic HTML to Markdown converter built for AI agents.

Audit any URL — no installation required:
bash
npx @markdown-for-agents/audit https://docs.github.com/en/copilot/get-started/quickstart HTML Markdown Savings
───────────────────────────────────────────────────
Tokens 138,550 9,364 -93.2%
Chars 554,200 37,456 -93.2%
Words 27,123 4,044
Size 541.3 KB 36.6 KB -93.2%Fetch any URL, convert the HTML to Markdown, and see exactly how many bytes and tokens you save. Useful for evaluating the impact of serving Markdown to AI agents instead of raw HTML.
Quick Start
No installation required — run directly with npx:
bash
npx @markdown-for-agents/audit https://example.com HTML Markdown Savings
───────────────────────────────────────────────────
Tokens 48,291 12,073 -75.0%
Chars 193,164 48,292 -75.0%
Words 9,456 5,209
Size 188.6 KB 47.2 KB -75.0%Options
npx @markdown-for-agents/audit <url> [options]
--no-extract Skip content extraction
--json Output as JSON
--print Print converted Markdown to terminal
--output <file> Save converted Markdown to file
-h, --help Show helpProgrammatic API
ts
import { audit } from '@markdown-for-agents/audit';
const result = await audit('https://example.com', { extract: true });
console.log(result.reduction.tokenPercent); // e.g. 82.6
console.log(result.markdown.content); // converted markdownResult shape
ts
{
url: string;
html: {
bytes: number;
tokens: TokenEstimate;
}
markdown: {
content: string;
bytes: number;
tokens: TokenEstimate;
}
reduction: {
bytes: number;
bytePercent: number;
tokens: number;
tokenPercent: number;
}
}Options
Accepts all markdown-for-agents options, plus:
fetchOptions— passed directly tofetch()for custom headers, auth, etc.
Related packages
| Package | Description |
|---|---|
markdown-for-agents | Core HTML-to-Markdown converter |
@markdown-for-agents/express | Express middleware |
@markdown-for-agents/fastify | Fastify plugin |
@markdown-for-agents/hono | Hono middleware |
@markdown-for-agents/nextjs | Next.js middleware |
@markdown-for-agents/web | Web Standard middleware |
License
MIT