I Tested HTML vs Markdown for AI Coding Agents!

DIY Smart Code
25,422 views •

Is Markdown or HTML more efficient for your coding agents? I tested both to find out which format saves you the most tokens. What you will see in this breakdown: → The test setup: comparing token usage across raw Markdown, freeform HTML, and HTML with templates → Impact on LLM context: how different structure choices affect your model's input limits and efficiency → The results: which format consistently requires fewer tokens for the same code output Optimizing your prompts is essential when building agentic workflows. By measuring the raw data, we can see exactly how Markdown vs HTML stacks up in practice, helping you manage your context window more effectively. ---- Higgsfield AI — Create AI Videos & Visuals Get 10% OFF here: https://higgsfield.ai?fpr=thomas-dccf7e 🚀 DYNAMOUS AI COMMUNITY Want to learn agentic coding with live daily events and workshops? Check out Dynamous AI: https://dynamous.ai/?code=646a60 Get 10% off here 👉 https://shorturl.smartcode.diy/dynamous_ai_10_percent_discount ⚡ HOSTINGER — RELIABLE HOSTING FOR YOUR PROJECTS (10% OFF) Whether you're shipping a portfolio, a side project, n8n flows, or AI agents — I use Hostinger for fast, affordable VPS + web hosting. Get 10% off here 👉 https://hostinger.com/DIYSMARTCODE n8n: https://n8n.partnerlinks.io/diysmartcode (Affiliate links — costs you nothing, supports the channel.) ---- Chapters 0:00 HTML vs Markdown for Claude Code: the 1M-View Comment Thread 0:47 Four Formats, Four Jobs, 72 Claude Code Runs 1:34 Status Report Tokens: 883 Markdown vs 7,204 Freeform HTML 2:29 Architecture Diagram and Drag-and-Drop Board: Up to 21x the Tokens 3:19 HTML Template Kit: Same Token Cost as Markdown, a Price You Can Plan For 4:54 Implementation Plans for Agents: 19/19 Hidden Tests Either Way 6:31 One Small Edit, and a Bug in a Freeform Plan 7:15 Limits: 1,000 Boards at List Price, Usage Limits, No Screenshots 8:02 When HTML Makes Sense (and When It Doesn't) 8:50 Repo + Who Won the Thread What you will see in this 9-minute breakdown: → Where freeform HTML tokens go: about three quarters is design (CSS, hand-drawn SVG, JavaScript) → Why the diagram run spent 5,091 thinking tokens on SVG coordinates → The one change that fixes it: content-only HTML components, design in a single kit.js file → Markdown plus a renderer: 569 tokens, the cheapest report in the test → Plans another agent builds from: same 19/19 tests, two thirds more cost for HTML plans → Run-to-run spread: freeform boards from 10.8k to 17.5k tokens, kit boards 573 to 625 → 1,000 boards at list price: about $361 freeform vs $39 with the kit → When HTML makes sense: who opens the file, how often you generate it, and the one case where freeform wins → The payback math for writing your own HTML template agent-html-kit (kit.js, Claude Code skill, the full 72-run benchmark): https://github.com/leex279/agent-html-kit The Short that started the thread: https://youtube.com/shorts/3DGN5kuG2xQ The top comment under my Short said simplicity is the feature. For plans, the numbers back it. For pages, a template made HTML just as cheap. So who won that thread: markdown, or HTML with a template? #ClaudeCode #ClaudeCodeTokenUsage #HTMLvsMarkdown #Markdown #HTML #ClaudeCodeTokens #TokenOptimization #AITokens #ClaudeAI #Anthropic #ClaudeOpus #AIAgents #CodingAgents #AICoding #PromptEngineering #ContextEngineering #DeveloperTools #WebDevelopment #LLM #Benchmark #VibeCoding

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close