Home / Guides / 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

Convert a PDF, Word file, or web page into clean Markdown you can paste into a notes app or a RAG pipeline. A free local tool handles many text files. The Apify Actor adds Word, OCR, and ready-made chunks.

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.

1. Open the Actor page.

2. Paste one or more file or page links (a sample PDF is already filled in).

3. Leave "Make chunks for AI search" on if you want chunks.

4. Click Start.

5. Download the Markdown from the key-value store (doc-1.md, doc-2.md, …), or export the dataset.

A short way to choose

Your situationWhat to use
A text PDF or HTML file on your computerFree doc2md-lite
You already have Markdown and only need chunksFree md-chunk-lite
Public links, Word files, scanned pages, or chunks in the cloudApify Actor

Related guides

These tools are made by Tidy Byte Tools.