Dev.to · 3 min read

How to turn a PDF or Word file into Markdown for AI and notes

How to turn a PDF or Word file into Markdown for AI and notes

You want the text out of a PDF, a Word file, or a web page — with the headings and tables still looking like headings and tables. Then you can paste it into a notes app, or cut it into chunks for AI search (RAG). Copy and paste from a PDF often breaks this. Headings vanish. Tables become a pile of words. Words split at the end of a line stay split. This page shows a better path, starting with a free local tool. What "clean Markdown" means here Good output looks like this: Headings use #, ##, ### Tables are real Markdown tables, not a jumble Lists stay as lists A hyphen at the end of a line is joined back to the next word For AI search, each chunk can keep its heading path and page numbers Free local tool: doc2md-lite doc2md-lite is a free tool you run on your own computer. It has a command-line tool and an MCP server for AI apps. There is no API key. What it does Turns many PDFs and HTML pages into Markdown. Tries to keep headings and tables. Runs offline. What it does not do Word (.docx) support and scanned-page OCR are stronger in the Apify Actor below. If a page is only a picture, the lite tool may return little or no text. It will not open a file that is behind a login. Install and run You need Python 3. pip install doc2md-lite doc2md-lite path/to/file.pdf -o file.md Open file.md in any text editor or notes app. If you want chunks for a vector database, see md-chunk-lite, which splits Markdown by heading and keeps the heading path. Cloud option: the Apify Actor PDF, Word and Web Page to Markdown accepts links to PDF files, Word (.docx) files, or web pages. It can also cut each file into RAG chunks. Each chunk keeps its heading path and page numbers. Chunks are free. You can get one dataset item per file, or one item per chunk (better for a vector database). Price (November 2026): $0.003 per file converted (a PDF's first 20 pages are included), $0.0003 for each PDF page after the first 20, and $0.005 per scanned page read with OCR. Failed links and files with no text are free. Apify also adds a small start fee per run. Honest limits: links must be public. Password-protected files and pages behind a login will not work in this Actor. OCR can misread a blurry scan. The Actor drops common web-page junk (menus, footers) unless you turn that off. Open the Actor page. Paste one or more file or page links (a sample PDF is already filled in). Leave "Make chunks for AI search" on if you want chunks. Click Start. Download the Markdown from the key-value store (doc-1.md, doc-2.md, …), or export the dataset. A short way to choose Your situation What to use A text PDF or HTML file on your computer Free doc2md-lite You already have Markdown and only need chunks Free md-chunk-lite Public links, Word files, scanned pages, or chunks in the cloud Apify Actor Related guides How to extract tables from a PDF into Excel or CSV How to check a website for broken links How to count LLM tokens and estimate cost These tools are made by Tidy Byte Tools. Originally published at https://snowrsps.com/tidybytetools/guides/turn-pdf-or-word-into-markdown-for-ai/. Tools by Tidy Byte Tools.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News