Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 3 min read

I built a PDF, Word and PowerPoint to Markdown tool for AI, and here is what it does with a real table

I made this tool, so I'm biased, and I used AI (Claude) to help write the code and this post. I'll show you where it works and where it doesn't. If you have ever pasted a PDF into ChatGPT or Claude, you know the problem

I made this tool, so I'm biased, and I used AI (Claude) to help write the code and this post. I'll show you where it works and where it doesn't.

If you have ever pasted a PDF into ChatGPT or Claude, you know the problem. Tables turn into a line of words and numbers, columns lose their meaning, and the AI answers from a mess.

I built a small tool that turns PDF, Word (.docx) and PowerPoint (.pptx) files into clean Markdown. Markdown is plain text that still shows headings, lists and tables, which AI tools read much better. It also cuts the result into chunks that follow the headings, which is what you need to build a "chat with your documents" search.

A real example

I ran it on a public document: the NIST Cybersecurity Framework 2.0 (a US government PDF). This is Table 1 on page 20.

Plain text extraction (the "copy and paste" version):

Function   Category   Category Identifier
Govern (GV)   Organizational Context   GV.OC
Risk Management Strategy   GV.RM
Roles, Responsibilities, and Authorities   GV.RR
Policy   GV.PO
Oversight   GV.OV
Cybersecurity Supply Chain Risk Management   GV.SC
Identify (ID)   Asset Management   ID.AM

An AI has to guess which words are the category and which are the code, and "Govern (GV)" only appears on the first line of its group.

What my tool gives you:

| Function Category | Category Identifier |
| --- | --- |
| Govern (GV) Organizational Context | GV.OC |
| Risk Management Strategy | GV.RM |
| Roles, Responsibilities, and Authorities | GV.RR |
| Policy | GV.PO |
| Oversight | GV.OV |
| Cybersecurity Supply Chain Risk Management | GV.SC |
| Identify (ID) Asset Management | ID.AM |

Now it is a real table: every row has its code in its own column. It is not perfect. The first two columns of the original (Function and Category) got merged into one cell. The data is all there, but you may want to clean that cell. (I re-ran this on the current version today and got the same result.)

What it does

  • Finds headings from font size and keeps bullet and numbered lists
  • Detects tables by column alignment and keeps each table in one piece
  • Reads two-column pages in the right order and removes repeated headers, footers and page numbers
  • Reads Word headings, lists and tables, and PowerPoint titles, bullets and speaker notes
  • Reads scanned PDFs and photos of pages with OCR (English)
  • Cuts the result into chunks that follow your headings, each with a token estimate and page numbers

What it does not do (yet)

  • OCR output is plain paragraphs: tables in scans are not rebuilt and headings are not detected. Blurry scans can misread numbers.
  • Old .doc and .ppt files, Excel files, password-protected PDFs.
  • Complicated tables (merged cells, multi-line cells, no clear columns) can come out misaligned or as plain text. Check the ones that matter.

Price

$0.003 per document (up to 100 pages), no start fee. Scanned pages cost $0.005 each on top. Failed downloads, corrupt files and unreadable scans are free. You can set a maximum cost per run and it stops before going over.

Try it

https://apify.com/tedock/doc-to-markdown?ref=devto

Paste a link to a PDF and run it. If it gets one of your documents wrong, tell me on the Actor's issues page. I answer within a day, and real failures are the most useful thing you can send.

tedock

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.