How do I make an LLM edit a .docx file without breaking formatting, which tool should I use?
We asked ChatGPT, Perplexity and Gemini this question on November 18, 2026. Here is who they named.
No brand was named by all three. python-docx was named by two.
| Brand | ChatGPT | Perplexity | Gemini |
|---|---|---|---|
| Named by two | |||
| python-docx | Named, position 3 | Not named | Named, position 1 |
| Named by one | |||
| Microsoft Word | Named, position 1 | Not named | Not named |
| PicoDocs | Not named | Named, position 1 | Not named |
| LangChain | Not named | Not named | Named, position 2 |
| LibreOffice | Named, position 2 | Not named | Not named |
| Retab Edit | Not named | Named, position 2 | Not named |
| Docx2txt | Not named | Not named | Named, position 3 |
| Quillwork | Not named | Named, position 3 | Not named |
| Aspose.Words | Named, position 4 | Not named | Not named |
| Safe-DOCX | Not named | Named, position 4 | Not named |
| Unstructured.io | Not named | Not named | Named, position 4 |
| Claude | Not named | Not named | Named, position 5 |
| Open XML SDK | Named, position 5 | Not named | Not named |
| docx4j | Named, position 6 | Not named | Not named |
| Microsoft Copilot | Not named | Not named | Named, position 6 |
| docx | Named, position 7 | Not named | Not named |
named, with its place in that answernot named
your companyIs it missing from this answer?
Run the free scanWhat each engine answered
ChatGPT
GPT-5.6, answering from model knowledge
- Microsoft Word
- LibreOffice
- python-docx
- Aspose.Words
- Open XML SDK
- docx4j
- docx
To edit a.docx without breaking formatting, do not have the LLM regenerate the document. Treat the LLM as the decision-maker and use a DOCX-aware library/tool to apply narrowly scoped edits.
Perplexity
Sonar with live web search
- PicoDocs
- Retab Edit
- Quillwork
- Safe-DOCX
Use a tool that edits the DOCX’s underlying XML or applies surgical text edits in place, rather than having the LLM regenerate the whole document. That approach is what preserves styles, tables, images, numbering, headers, and page layout.
Gemini
Gemini 3.1, answering from model knowledge
- python-docx
- LangChain
- Docx2txt
- Unstructured.io
- Claude
- Microsoft Copilot
Editing a.docx file with an LLM is challenging because.docx files are actually zipped XML files. If you simply paste the text into an LLM, you lose the document structure, styles, headers, footers, and images. To edit a file without breaking the formatting, you should never have the LLM reconstruct the file from scratch. Instead, you should use a "Programmatic Extraction & Injection" approach.
Sources Perplexity cited
Perplexity searched the web for this answer. The count is how many times the answer cited that site.
- github.comcited 4 times
- typingmind.comcited 2 times
- docs.retab.comcited once
- vespper.comcited once