Analysis

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

DocumentPagesMarkdown TokensNative Upload CostReduction
Attention Is All You Need (ArXiv)1515,08722,500–45,00033%–67%
Physics dissertation (212pg)212147,312318,000–636,00054%–77%
Apple 10-K annual report10583,933157,500–315,00047%–73%
Short technical reference21,0343,000–6,00066%–83%
Simple invoice13431,500–3,00077%–89%
IRS tax form25,8993,000–6,000−97%–2%
Dense checkbox government form69,0129,000–18,0000%–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 TypeMarkdown TokensRaw HTML SourceReduction
Wikipedia article71,821317,61777%
Documentation page6,56591,91593%
Blog post8,174112,23493%
News article2,69843,88794%
Technical docs11,79050,26977%

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.

FormatTested DocumentsToken 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

Explore Specific Formats & Tools