MarkItDown: Microsoft’s open source universal converter, convert PDF/Word/PPT into Markdown with one clickMarkItDown:微软开源的万能转换器,PDF/Word/PPT 一键变 Markdown
If the document format fed to AI is incorrect, the model will lose content when reading it. Microsoft's open source MarkItDown specializes in this: converting PDF, Word, Excel, PPT, pictures, audio, and HTML into clean Markdown. The structure, titles, and tables are all preserved, and can be directly inserted into large models.
喂给 AI 的文档格式不对,模型读起来就会丢内容。微软开源的 MarkItDown 专治这件事:把 PDF、Word、Excel、PPT、图片、音频、HTML 统统转成干净的 Markdown,结构、标题、表格都保留下来,直接就能塞给大模型。

Why can’t this step of conversion be omitted?为什么转换这一步不能省
Directly letting the model read the PDF will cause two common mistakes: First, the scanned version has no text layer at all, and the model can only see blank spaces; second, when the layout is complex, the table is broken into a string of garbled characters.
The idea of MarkItDown is to first perform structured analysis and output Markdown with title levels, lists and tables. The reading effect of the model is significantly better than the original binary stream.
It also retains document meta-information, such as title, author, etc., and these fields are directly available when entering the knowledge base.
直接让模型读 PDF,常见两种翻车:一是扫描版根本没有文字层,模型只能看到空白;二是版面复杂时,表格被打散成一串乱码字符。
MarkItDown 的思路是先做结构化解析,输出带标题层级、列表和表格的 Markdown,模型的阅读效果明显好于原始二进制流。
它同时保留了文档元信息,例如标题、作者等,做知识库入库时这些字段直接可用。

Supported input formats支持的输入格式
Office documents: Word (docx), Excel (xlsx), PowerPoint (pptx), PDF.
Web pages and data: HTML, CSV, JSON, XML, ZIP compressed packages (can process internal files recursively).
Multimedia and more: images (optional for OCR), audio (optional for speech transcription), Jupyter notebooks, EPUB e-books, and YouTube video links (requires additional components).
办公文档:Word(docx)、Excel(xlsx)、PowerPoint(pptx)、PDF。
网页与数据:HTML、CSV、JSON、XML、ZIP 压缩包(可递归处理内部文件)。
多媒体与其它:图片(可接 OCR)、音频(可接语音转写)、Jupyter 笔记本、EPUB 电子书,以及 YouTube 视频链接(需要额外组件)。

Three steps to get started三步上手
Go to the "AI Tools" section of this site to download the tar.gz source code package, unzip it and enter the directory to execute the installation command: pip install.
Convert a single file: Specify the input file and output file on the command line, for example, convert quarterly report.pdf to report.md.
Convert entire folders in batches: Write a few-line loop script to traverse the directory, convert a cabinet of documents into Markdown at once, and then uniformly slice them into your knowledge base.
到本站「AI工具」栏目下载 tar.gz 源码包,解压后进入目录执行安装命令:pip install .
转单个文件:在命令行里指定输入文件与输出文件,例如把季度报告.pdf 转成 report.md。
批量转整个文件夹:写个几行的循环脚本遍历目录,一次性把一柜子文档转成 Markdown,再统一切片入库到你的知识库。

Practical matching suggestions实战搭配建议
Use it with local knowledge base tools: first use it to convert the data into Markdown, and then hand it to the search tool to build the index. The hit rate and answer quality will be more stable.
Before conversion, spot-check two or three complex documents to confirm that the tables are not misaligned, and then process them in batches to avoid running through them in vain.
Remember to connect the scanned document to the OCR component first, otherwise only blank content will be output.
配合本地知识库工具使用:先用它把资料转成 Markdown,再交给检索工具建索引,命中率和答案质量都更稳。
转换前先抽查两三份复杂文档,确认表格没有错位,再批量处理,避免白跑一遍。
扫描件记得先接 OCR 组件,否则转出来只有空白内容。

Notes使用提醒
This article is compiled from public sources and ships with the matching resource. Product features and pricing are subject to the official page. Resources are for learning and exchange only — please respect the original license.
本文整理自公开资料并附上配套资源;涉及产品的功能与价格以官方页面为准。资源仅供学习交流,请遵循来源许可。
⬇ Download · 点击下载:MarkItDown v0.1.8(Python 源码包 tar.gz)(67KB)
微软官方开源(MIT)。解压后执行 pip install . 安装;PDF 等格式的额外解析支持可用 pip install markitdown[all] 一并装齐。
阅读与点赞数据保存在你的浏览器本地,欢迎留下你的想法。
今日正能量学一点,用一点;今天种下的种子,会长成明天的能力。去免费下载专区 →广告
评论 文明发言,让讨论更有价值