By the end of this guide you will have a repeatable way to parse PDFs for an LLM: a pipeline that takes messy files, including scans, tables and multi-column layouts, and turns them into clean Markdown or structured JSON that a model or a retrieval system can use. The tools that do this are document parsers, which read page layout rather than just extracting raw text.
Parsing is the step that decides how good your answers can be, because a model cannot cite a table that was flattened into nonsense. This guide explains the types of parser, walks through building and checking a pipeline, and compares seven options from our Developer platforms category.
Key takeaways
- Parse for structure, not just text: layout, reading order and tables are what make retrieval and citations work.
- The main decision is open-source library you run yourself versus hosted API billed by page or credit, and whether you need Markdown for retrieval or JSON that follows a schema.
- Test on your worst documents (scans, wide tables, forms) before you parse a whole archive, and compare the output with the original pages.
- Extraction can still make mistakes. Have a person check figures from invoices, contracts, medical or financial documents.
What you need before you start
- A sample set of documents. Pick 10 to 20 files that include your hardest cases: scanned pages, dense tables, multi-column text, handwriting, forms.
- A target output. Decide whether you need Markdown for chunking and retrieval, or JSON with named fields.
- A way to call the tool. A Python environment for libraries, or an API key for hosted services.
- A place for the output. A folder, a database or a vector store.
- Permission to process the files. Check privacy and confidentiality terms before sending documents to a hosted service.
- Time. A small test pipeline takes under a day. Difficulty is moderate: you will write a little code and compare outputs by eye.
Which kind of AI tool fits this job
Choose by where the documents may go and what shape of output you need.
An open-source parser you run yourself. Docling reads PDF, Office files, images and more, works out page layout, reading order, tables, code and formulas, applies OCR to scans, and exports to Markdown, HTML or JSON. It can run locally for sensitive or air-gapped data and is free under the MIT license. The trade-off is that you run it on your own hardware.
A framework with a hosted parsing service. LlamaIndex pairs an open-source framework for ingesting and querying documents with the LlamaParse platform, which offers Parse, Extract, Classify, Split and Index in credit-priced tiers.
A pipeline platform that connects sources to a vector store. Unstructured builds pipelines that connect to sources such as S3 and SharePoint, partition and chunk files, enrich them with metadata, optionally create embeddings, and write to destinations such as Pinecone and Elasticsearch.
A document API for structured extraction. Reducto, Extend and Pulse parse files with layout detection and also extract JSON that follows a schema, with citations or bounding boxes. Reducto and Pulse list Markdown output. Reducto adds Split, Classify and Edit, Extend adds Verify for tampered documents, and Pulse offers table and chart extraction.
A specialist for equations and technical content. Mathpix is built around equations, tables and chemistry, and exports to LaTeX, Markdown, DOCX and other editable formats. It fits scientific and academic material that general parsers tend to mangle.
Step 1: Collect a representative sample
You finish with a small folder that stands in for your whole archive.
- Pick files from each source and type you will process.
- Include the ugly ones: low-quality scans, rotated pages, tables spanning pages, scientific notation.
- Note the language of each file.
- Write down what a perfect parse would look like for three of them, for example the exact cells of one table.
Check it worked by having a ground-truth note for at least three pages.
Step 2: Decide the output shape
The output format drives both the tool and the downstream design.
- For question answering over long text, choose Markdown with headings and tables preserved.
- For forms, invoices or contracts where you need fields, choose JSON with a schema you define.
- For citations in answers, choose a tool that returns bounding boxes or source locations. Reducto, Extend and Pulse list both bounding boxes and citations.
- Decide whether the files may leave your network, since that rules hosted APIs in or out.
Check it worked by writing the target format for one document by hand.
Step 3: Pick two or three candidates
Compare a library, a hosted API and, if needed, a specialist.
- If privacy is the priority, start with Docling, which can run locally for sensitive or air-gapped data.
- If you want a managed service, shortlist one or two of Reducto, Extend, Pulse or LlamaParse and note how each is billed.
- For maths-heavy papers, add Mathpix.
- Use the comparison table below to check limits such as free allowances and seats.
Check it worked by having a shortlist with a billing unit noted for each tool.
Step 4: Run your sample through each candidate
Run the same files through every candidate with default settings first.
- Create accounts or install the libraries. Docling's listing says Python 3.10 or higher is required.
- Parse each sample file and save the output to a folder named after the tool.
- Use the highest-quality mode on the hardest files if the tool has tiers. LlamaParse has Fast, Cost-effective, Agentic and Agentic Plus tiers, and Extend has Light, Performance and Auto modes.
- Note the time taken and, for hosted tools, the credits or cost used.
Check it worked by having one output folder per tool with the same file names.
Step 5: Compare the output with the original pages
Judge the parsed text against the page, not against your expectations.
- Open the original PDF next to the parsed Markdown or JSON.
- Check reading order in multi-column pages.
- Check that tables keep their rows and columns, including tables that cross pages.
- Check numbers, units and symbols against the ground-truth notes from Step 1.
- For scans, look for OCR errors in names and figures.
Check it worked by scoring each tool on the same short checklist and picking the one with the fewest structural errors.
Step 6: Build the pipeline: parse, chunk, index
Now connect the winning parser to the rest of your RAG system.
- Parse each document and save the Markdown or JSON along with the source file name and page.
- Chunk the text along natural boundaries such as headings and tables, so a table is not split in the middle. Unstructured lists chunking by character, title, page or similarity.
- Add metadata (title, date, source) to each chunk.
- Create embeddings and write them to your vector store.
- Keep the original files, so you can re-parse them when a tool improves.
Check it worked by asking five questions whose answers sit in tables and confirming the retrieved chunk contains the right table.
Step 7: Add checks, citations and monitoring
Parsing errors are quiet, so build in ways to catch them.
- Show the source page or bounding box next to each answer wherever the tool supplies one.
- Flag documents with very little parsed text, which often means a failed scan.
- Route high-stakes fields, such as amounts and dates, to a person for review.
- Re-run the sample set whenever you change the tool, the tier or its settings.
Check it worked by deliberately feeding a blurred scan and confirming it is flagged rather than silently accepted.
Tools for this job compared
| Tool | Good fit for | Pricing | Stated limits |
|---|---|---|---|
| Docling | Local, open-source parsing to Markdown or JSON; CLI, API, self-hosted | Open source | You run it on your own hardware; individual models carry their own licenses; metadata extraction listed as coming soon |
| Reducto | Parse, Extract, Split and Classify API with a Studio workspace | Free trial, paid from $10, usage-based (checked 24 Oct 2026) | Standard includes up to 5 Studio seats; dense extractions may add a per-field surcharge |
| LlamaIndex | Open-source framework plus LlamaParse credits; web and API, with self-hosting for enterprise customers | Freemium, paid from $50/mo (checked 24 Oct 2026) | Free plan returns a 402 error once credits are used; files cached for 48 hours unless you opt out |
| Unstructured | Source-to-vector-store pipelines with connectors | Freemium, paid from $0.03, usage-based (checked 24 Oct 2026) | Some connectors are preview; dedicated instance and in-VPC deployment are Business only |
| Extend | Parse, Extract and Verify APIs with SDKs and a CLI | Freemium, paid from $0.01, usage-based (checked 24 Oct 2026) | Pay As You Go concurrency is 60 documents and 500 pages; SSO, SAML and private VPC are Enterprise only |
| Pulse | Markdown, tables and charts through an API or web platform | Freemium | Credit cost varies by endpoint and page; zero data retention and on-prem are tied to Enterprise |
| Mathpix | Equations, tables and chemistry to LaTeX or Markdown | Freemium, paid from $4.99/mo (checked 24 Oct 2026) | Free plan covers 10 PDF pages and 10 images per month; API keys need a one-time $19.99 setup fee |
Prices and plan limits change, so confirm the current terms on each vendor's site before you commit.
Common mistakes to avoid
- Extracting plain text only. It happens because text extraction is the default. The result loses tables, reading order and headings. Fix it by parsing to Markdown or JSON with layout preserved.
- Judging a parser on easy files. Clean single-column PDFs work in almost any tool. Fix it by testing on your worst scans, tables and forms.
- Choosing by price per page alone. Tiers, modes and extra products change the real cost, and Extend bills Parse separately when you use Extract or Split. Fix it by running the sample set and calculating the cost of a full run.
- Sending confidential documents to a hosted service unchecked. Some tools cache files, as LlamaIndex does for 48 hours by default, and some retention options are Enterprise only. Fix it by reading the data terms, or use a local tool such as Docling.
- Trusting extracted numbers. Extraction models can still get values wrong. Fix it by validating key fields and having a person check anything financial, legal or medical.
How we put this together
This is an evidence-based guide built from each tool's listing in our directory, which is compiled from the vendor's own site and pricing page. It is not a review based on using the tools. We don't rank tools, and nobody paid to be included. Some outbound links may be affiliate links; see our disclosure.
Frequently asked questions
Is there a free way to parse PDFs for an LLM?
Yes. Docling is free under the MIT license and runs on your own hardware. Hosted services also have free allowances, such as the LlamaIndex Free plan with a monthly credit allowance, Unstructured's free pages each month, and free starting credits on Reducto and Extend. Each has limits.
Should I parse to Markdown or JSON for an LLM?
Neither is better in general. Markdown keeps headings and tables readable and suits retrieval and chunking, while JSON that follows a schema suits extracting named fields such as invoice totals. Many tools in this guide can produce both.
Can AI parse scanned PDFs?
Yes, with OCR. Docling, Reducto and Pulse list OCR, Extend lists handwriting detection, and Mathpix is built for scans, handwriting and equations. Quality varies with scan quality, so test your own files and check the numbers.
Can I keep my documents private?
Docling can run locally for sensitive or air-gapped data. Several hosted tools offer private deployment, such as VPC or on-premises options, usually on enterprise plans. Read each vendor's data terms before uploading confidential files.
How long does it take to set up a PDF parsing pipeline?
It depends on how many document types you have and how many tools you compare. Wiring up the parser is usually the smaller part; most of the effort goes into comparing the output with your original documents and handling the awkward files. Expect to revisit settings as new document types arrive.
Compare more options in our Developer platforms category.