A developer post on DEV.to is making a simple but expensive point: when you're building a RAG pipeline or an LLM agent that reads web pages, the format you stuff into the context window matters more than most engineers realize. Originally published on the Scrapio blog and cross-posted under the handle xsron_hou_9dc0afce46615a8, the piece argues that raw HTML and clean markdown can represent identical information โ but at wildly different costs to your token budget. The headline claim is stark: one of those formats costs roughly 10x more than the other. Given the post's framing, the expensive one is HTML, which drags along tags, attributes, and boilerplate that add noise without adding signal for a language model trying to extract meaning from a page.
The Token Math Nobody Runs
Context windows are finite, and every wasted token on nested divs and class names is capacity your model can't spend on actual content. For teams running retrieval-heavy workloads โ scraping pages, chunking them, then embedding or prompting against them โ that overhead isn't cosmetic; it's a direct line item in per-request cost and latency. The practical implication is straightforward: if you're pulling web pages into your RAG stack, converting HTML to markdown before it ever reaches the context window could be one of the cheapest optimizations available. Cleaner input means more relevant content fits per request, and models tend to follow structure better when they aren't parsing markup soup.
What This Means for Pipeline Design
This isn't a new debate โ markdown has long been praised as human-readable and lightweight โ but the LLM angle sharpens it considerably. The post's framing suggests format choice should be treated as part of retrieval strategy, not an afterthought buried in your scraper config.
Key Takeaways
- Feeding raw HTML to LLMs can cost roughly 10x more tokens than equivalent markdown.
- Format selection belongs in RAG and agent pipeline design, not just front-end tooling.
- The argument originated on the Scrapio blog before landing on DEV.to for wider distribution.
The Bottom Line
Markdown's win here isn't nostalgia for lightweight syntax โ it's arithmetic. If your agents are reading the web, strip the markup before you pay for it. Token efficiency is the cheapest performance upgrade most pipelines never bother to measure.