Why do AI agents work better in markdown or HTML than in Word and Excel files?
Last updated 2026-08-17 · Confidence: documented — Anthropic’s own docx/xlsx agent skills, Google’s markdown docs, and the GPT-3 dataset table; the style-guide-degradation answer is inferred.
Markdown and HTML are plain text the model reads and edits directly — and the bulk of what it trained on; Word and Excel files are zipped XML it must manipulate through code without ever seeing the rendered page. Draft in markdown or HTML, and convert to Office early, once, to de-risk the conversion step.
Office files are edited blind, through code
Section titled “Office files are edited blind, through code”Anthropic’s own Word skill shows what “editing a .docx” means to an agent: read it by converting to markdown with pandoc, edit it by unzipping the archive and rewriting word/document.xml raw (“do NOT reformat or pretty-print” — corruption risk), then check the result by converting to PDF and rendering JPEG screenshots. Word also fragments each paragraph across many XML runs, so even find-and-replace needs a run-merging script first.
The Excel skill is the same story: openpyxl and pandas over the file, plus a mandatory headless-LibreOffice pass because openpyxl writes formulas with “no cached values” — and the agent never sees fonts, colors, or rendered layout.
Plain text is both edit surface and training data
Section titled “Plain text is both edit surface and training data”A markdown or HTML file needs no toolchain: the text the agent edits is the deliverable. And web pages dominate training corpora — GPT-3’s mix was 82% web crawl (Common Crawl 60%, WebText2 22%) — which is why design-heavy drafting goes better in HTML than in .docx, and why Claude Design exists as a surface for it.
Draft plain, convert early
Section titled “Draft plain, convert early”Iterate in markdown — HTML when layout matters — and convert the first draft to the deliverable format with a screenshot check, so conversion surprises surface before the deadline. For Google Docs, Google documents the paste route: enable markdown under Tools > Preferences, then right-click > Paste from Markdown keeps headings, bold, and links; File > Open imports whole .md files by default. Other routes into Docs and Sheets: Docs write path; for feeding spreadsheets in rather than out, spreadsheets into agents.
Q&A from calls
Section titled “Q&A from calls”Did repeated AI edits degrade a .docx style guide because of the format? The mechanism is real: each edit rewrites XML the agent can’t see rendered, the vendor’s own tooling warns such edits can corrupt files, and without a render-and-inspect step layout regressions are invisible to the model — so blind edits compound. But a loop that worsens each round is also the signature of a stuck long session (long-context degradation), so the format can’t be confirmed as the cause after the fact.
Sources
Section titled “Sources”- Word document skill — SKILL.md — github.com/anthropics
- Excel spreadsheet skill — SKILL.md — github.com/anthropics
- Import and export Markdown in Google Docs — Google Workspace Updates
- Use Markdown in Google Docs, Slides, & Drawings — Google Docs Editors Help
- Language Models are Few-Shot Learners (GPT-3), Table 2.2 — arXiv