# How to Benchmark a Document Parser on Your Own PDFs

Canonical URL: https://webcite.co/blog/benchmark-document-parser/ | Author: Teja Thota | Published: 2026-11-25

How to benchmark a document parser: run ParseBench on a trial subset, compare two parsers, test your own PDFs, weight what matters and estimate the cost.

To benchmark a document parser, run it and one alternative on the same pages, score both against reference answers, and compare them by dimension rather than by the overall number. ParseBench is LlamaIndex's open benchmark for this, and it runs from the command line on 4,317 public test pages or on a folder of your own PDFs.

Webcite wrote this guide and has a row on the ParseBench 2 leaderboard; commands are quoted from the sources listed at the end.

## How do you set up ParseBench?

You need Python with [uv](https://docs.astral.sh/uv/), the ParseBench harness, and an API key for each hosted parser you plan to test. Install from a checkout of the repository, as [the ParseBench README](https://github.com/run-llama/ParseBench) shows:

```bash
git clone https://github.com/run-llama/ParseBench
cd ParseBench
uv sync --extra runners
uv run parse-bench pipelines
```

The last command lists the available pipelines, which the README counts at more than 180 parsers and configurations. Put each key in an environment file at the project root, for example `LLAMA_CLOUD_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY` or `GOOGLE_API_KEY`. Keys only call the parser under test, and scoring makes no model calls unless you opt in.

## How do you run a trial and compare two parsers?

Run one small subset first, so a setup mistake costs cents rather than dollars. ParseBench 2 splits into subsets that roll up into six dimensions, and the group option picks some of them:

```bash
uv run parse-bench run llamaparse_agentic --dataset parsebench-2 --group charts,tables
uv run parse-bench status --dataset parsebench-2
```

The first command downloads the dataset into `./data_parsebench-2` and runs the pipeline; the second shows how many cases each subset holds. To test Webcite's API, the [reproduction guide](https://webcite.co/api-docs/parsebench) uses the headings subset:

```bash
export WEBCITE_API_KEY="YOUR_API_KEY"
export WEBCITE_BASE_URL="https://api.webcite.co/api/v1"
uv run parse-bench run webcite --dataset parsebench-2 --group headings --max_concurrent 4
```

The Webcite pipeline arrives in ParseBench with Webcite's provider pull request, so it installs from the standard repository once that pull request is merged. For any hosted parser, keep the concurrency setting within your plan's limit per minute.

Run the second parser on the same subsets, then put the two side by side. Scores land in `output/parsebench-2/_score/<pipeline>/_next_score.json`, and the harness can compare and display them:

```bash
uv run parse-bench compare <pipeline_a> <pipeline_b>
uv run parse-bench serve <pipeline_a>
```

`serve` opens an HTML report with each test case beside its page. Read the failures, not only the scores. A parser that loses a point by rounding a number is a different risk from one that loses a point by swapping two table headers.

## How do you test a parser on your own PDFs?

Point the run at a folder of your PDFs. ParseBench can first write a repetition test for each file from its text layer, according to [the README](https://github.com/run-llama/ParseBench):

```bash
uv run parse-bench repetition make ./my_docs
uv run parse-bench run <pipeline_name> --input_dir ./my_docs
```

A repetition test fails an output that repeats a dot leader, a table row or a whole table more often than the page holds it, and it fails an empty answer. That catches a common failure on long tables and scans, but it does not check that any value is right.

For values, write your own tests. The harness reads a test file stored next to each PDF and named after it, as the [test case loader](https://github.com/run-llama/ParseBench/blob/main/src/parse_bench/test_cases/loader.py) shows. You can also run any Hugging Face dataset in the ParseBench layout with `--dataset org/name`, which suits a team that wants a private, versioned test set.

Take 50 to 100 pages, weighted to the kinds you process most, and include the hard ones: scans, dense tables, charts, filled forms and rotated pages. Write expected values only for the fields your application uses. Keep the set fixed, so results from different months stay comparable. Checking those fields by hand once is slow, but it is the only way to know what a parser gets wrong on your documents.

## How do you read the results?

Read the dimension that matches your documents first, then the failures, then the cost. Two scoring rules from [the README](https://github.com/run-llama/ParseBench) explain most surprises. A page score is "the lower of a content-recovery score and a severity cap", so one serious error caps the page. The overall score is "the unweighted mean of the six dimensions", which is rarely how a real workload looks.

To weight dimensions your way, rescore the saved results instead of rerunning the parsers. ParseBench's Metric Lab exports a policy file with your own weights and error classes, and the rescore command applies it without new inference:

```bash
parse-bench evaluation run ./output/parser --next=text --next_only
parse-bench rescore ./output/parser --policy parsebench-policy.json --next=text
```

A team that processes tax forms can weight forms heavily and charts lightly, then see whether the ranking changes. The [ParseBench 2 results explained](https://webcite.co/blog/parsebench-2-results-explained/) post shows how far rankings already move between dimensions on the public leaderboard.

Treat small gaps as ties. [Webcite's benchmarks page](https://webcite.co/benchmarks) says its own scores move by about half a point per dimension between runs, because pages are read from their images. Record the dataset and harness versions with every result, since the ParseBench 2 dataset had several releases in November 2026.

Run the full set only for the finalists. A full run costs roughly the parser's price per page times 4,317, and the [leaderboard](https://github.com/run-llama/ParseBench/blob/1908f9a/leaderboard-v2.csv) lists that price for most hosted parsers. LlamaParse Cost Effective is listed at 0.375 cents a page, which puts 4,317 pages near $16. Vendors' own price lists can differ, as the [PDF to Markdown API pricing comparison](https://webcite.co/blog/pdf-markdown-api-pricing-compared/) shows.

A benchmark score ends at the page. If the parsed text feeds answers, check the claims in those answers against their sources too. [The extraction quickstart](https://webcite.co/api-docs/extraction) covers the parsing call, and [the best PDF parser for RAG guide](https://webcite.co/blog/best-pdf-parser-for-rag/) covers choosing a parser for retrieval.

## Sources and method

Commands and scoring rules: the [ParseBench README](https://github.com/run-llama/ParseBench) and [test case loader](https://github.com/run-llama/ParseBench/blob/main/src/parse_bench/test_cases/loader.py), and Webcite's [ParseBench reproduction guide](https://webcite.co/api-docs/parsebench), read 25 November 2026. Prices per page: [leaderboard-v2.csv at commit 1908f9a](https://github.com/run-llama/ParseBench/blob/1908f9a/leaderboard-v2.csv), snapshot of 20 November 2026. Dataset releases, including 16, 18 and 24 November 2026: the [ParseBench 2 dataset card](https://huggingface.co/datasets/llamaindex/ParseBench-2).

## Frequently Asked Questions

### Can ParseBench score my own documents?

Yes. Point the run at a folder of PDFs with `--input_dir`. The repetition make command writes a basic test for each file, and you add test files next to each PDF for the values your application depends on.

### How much does a full ParseBench 2 run cost?

Roughly the parser's price per page times 4,317, the number of public test pages. The leaderboard's cost column gives a first estimate for most hosted parsers; open weight models cost whatever your own hardware does.

### How many pages do I need to compare parsers?

Start with 50 to 100 of your own pages, weighted to the kinds you process most, and add pages wherever the parsers disagree. Disagreements show you where the real risk is.
