Token Savings Analysis: Raw Files vs. Markdown
Not every file format wastes tokens the same way. We tested real documents across PDF, HTML, Word, PowerPoint, and Excel to find out exactly where converting to Markdown saves tokens — and where it doesn't, but matters for a different reason: keeping your data structured instead of garbled.
Where Markdown saves real tokens
AI providers process PDFs expensively — Claude's own documentation confirms each page gets processed as both text and an image, costing 1,500–3,000 tokens per page regardless of content. HTML has no file-upload equivalent — people paste raw page source directly, tags and all. Both of these carry real, avoidable overhead that Markdown strips out.
.pdf PDF Documents
| Document | Pages | Markdown Tokens | Native Upload Cost | Reduction |
|---|---|---|---|---|
| Attention Is All You Need (ArXiv) | 15 | 15,087 | 22,500–45,000 | 33%–67% |
| Physics dissertation (212pg) | 212 | 147,312 | 318,000–636,000 | 54%–77% |
| Apple 10-K annual report | 105 | 83,933 | 157,500–315,000 | 47%–73% |
| Short technical reference | 2 | 1,034 | 3,000–6,000 | 66%–83% |
| Simple invoice | 1 | 343 | 1,500–3,000 | 77%–89% |
| IRS tax form | 2 | 5,899 | 3,000–6,000 | −97%–2% |
| Dense checkbox government form | 6 | 9,012 | 9,000–18,000 | 0%–50% |
Note: Form-heavy documents with lots of checkboxes and short fields don't compress well — Markdown's table syntax can cost more than the sparse original content. Academic papers, reports, and prose-heavy documents see the strongest gains.
.html Webpages (HTML)
| Page Type | Markdown Tokens | Raw HTML Source | Reduction |
|---|---|---|---|
| Wikipedia article | 71,821 | 317,617 | 77% |
| Documentation page | 6,565 | 91,915 | 93% |
| Blog post | 8,174 | 112,234 | 93% |
| News article | 2,698 | 43,887 | 94% |
| Technical docs | 11,790 | 50,269 | 77% |
Where Markdown isn't about saving tokens — it's about not losing your data
Word, PowerPoint, and Excel work differently. Neither Claude nor ChatGPT charges the heavy per-page image tax on these formats the way they do PDFs — Anthropic's own docs tell developers to convert Word files to plain text before sending them, and spreadsheets get routed through a code-execution sandbox rather than raw context tokens. So converting these to Markdown doesn't shrink your token count. In our testing, it actually costs 10–155% more tokens than a naive paste.
What it buys instead: raw-pasted Word text loses table alignment and heading structure. Raw-pasted Excel data loses column boundaries, causing the AI to misread which number belongs to which category. Raw-pasted PowerPoint text loses which bullet belongs to which slide, and speaker notes vanish. Markdown's extra tokens are the cost of keeping your data usable.
| Format | Tested Documents | Token Difference vs. Raw Paste |
|---|---|---|
| .docx Word (.docx) | 5 real reports/syllabi | +10% to +93% |
| .pptx PowerPoint (.pptx) | 4 real slide decks | +20% to +155% |
| .xlsx Excel (.xlsx) | 3 real datasets | +18% to +33% |
Methodology
PDF savings are measured against Claude's documented per-page native-upload cost. HTML savings are measured against the raw page source a person would otherwise paste directly. Word and PowerPoint are measured against plain-text extraction (approximating what AI providers actually do internally, per their own documentation). Excel is measured against tab-separated paste (approximating copy-pasting cells directly into a chat). Last tested July 2026 across 23 real documents.
Before & After: Real Example
We converted a real, publicly verifiable 15-page academic paper (Attention Is All You Need) to Markdown and compared its token weight against the standard native-upload penalties of modern LLMs.
Primary Example: Academic Paper (15 pages)
- Markdown Tokens (Our Tool)12,026 tokens
- Direct Upload Range (Claude/GPT)22,500 – 45,000 tokens
- Token Reduction vs Direct Upload46.5% – 73.3%
Frequently Asked Questions
Why do PDFs waste so many tokens?
PDFs are essentially visual documents. When uploaded directly to modern LLMs, they are often processed using Vision APIs (turning pages into images) or complex internal parsers that extract positional data, bounding boxes, and whitespace. This overhead consumes massive amounts of tokens before the AI even reads your text.
Does this affect API costs or just context window limits?
Both. Since you pay per token when using APIs like OpenAI or Anthropic, uploading raw files will dramatically inflate your API bill. For chat interfaces, the bloated token count forces you to hit your context window limit (or your hourly message cap) much faster.
Is Markdown always more efficient than raw text?
Not for every format. For PDFs and HTML, yes — Markdown is dramatically more efficient than a direct upload or raw page source. But for Word, PowerPoint, and Excel, converting to Markdown typically uses MORE tokens than a raw paste, not fewer — see the breakdown above. The tradeoff there isn't about token count, it's about whether the AI can actually understand your document's structure.
Will the AI lose important information?
For text-based documents, no — our converter extracts all semantic text, tables, headers, and lists. It only discards the hidden presentation layer (fonts, CSS, layout coordinates) that the AI doesn't need. The exception is scanned or image-based PDFs with no underlying text layer — since there's no extractable text to begin with, OCR support for these is on our roadmap.
Start saving tokens today
Convert your first file to Markdown for free and see the difference in your next AI prompt.
Convert a file now