ForHosting KIT · Documents & PDF

Compare two PDFs by text

Compare two PDFs without repeatedly switching between windows or trusting a visual scan.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Provide the extracted text from each document as one string per page, and this tool reports exactly which page numbers differ. Each changed page receives a short, deterministic summary with word counts and the words added or removed. It also identifies pages that occur in only one version. The comparison runs without network access, preserves page order, and rejects either document when it contains no extracted text.

Prepare page text that preserves document structure

Start with text already extracted from both PDF files. Supply each document as an ordered array in which the first string is page one, the second string is page two, and so on. Keeping page boundaries intact is essential because the result reports differences by page number rather than treating the document as one continuous block. Text extraction tools may produce repeated spaces, tabs, or line breaks, so the comparison normalizes runs of whitespace before deciding whether page text changed. This avoids flagging a page merely because one extractor wrapped a sentence differently. It does not perform optical character recognition, open PDF files, or infer missing page boundaries. If a scanned document has no text layer, run OCR first and pass its page-level output here. Review extraction quality when fonts, columns, or tables produce unusual reading order. Both inputs must contain at least one page with non-whitespace text; an empty array, a missing input, or pages containing only whitespace produce an input error instead of a misleading equal result.

Understand how changed pages are summarized

The tool compares corresponding page positions after normalizing whitespace. Identical normalized text produces no difference entry. When a page changes, the summary tokenizes both versions into words, compares case-insensitive word frequencies, and reports how many words were removed and added. A brief preview lists up to five removed and five added words, making changes such as an updated amount, date, party name, or clause term easy to spot. Counts preserve repeated occurrences, so deleting the same term twice registers two removals. If the words are the same but their order, capitalization, or punctuation differs, the page is still marked as modified and the summary explains that word order or punctuation changed. This is a concise diagnostic rather than a character-by-character patch. It deliberately avoids guessing semantic importance or claiming that two differently written provisions mean the same thing. Use the listed page numbers to focus a human review, especially for contracts, financial statements, regulated documents, and layouts where a textual change may affect meaning.

Interpret missing pages and use the result safely

Documents do not always have the same length. When one input has additional page positions, each extra page is reported with a status indicating that it exists only in PDF A or only in PDF B, together with its extracted word count. The top-level result includes both page totals, an ordered list of differing page numbers, a detailed entry for every difference, and an equal flag for quick automation. This makes the output useful in release checks, approval workflows, archival validation, and document ingestion pipelines. A true equal flag means the normalized extracted text matched page by page; it does not prove that images, annotations, signatures, colors, fonts, metadata, hidden layers, or geometric placement are identical. Conversely, extraction differences can reflect changes in the PDF encoding rather than an intentional editorial revision. For high-stakes review, treat this report as a reliable way to locate textual differences, then inspect the original pages and apply the legal, financial, or operational judgment appropriate to the document.

Review a revised contract

Locate the pages whose extracted wording changed before examining the affected clauses in the signed or proposed originals.

Check a report before publication

Compare draft and final page text to catch changed amounts, dates, labels, or accidentally added and removed pages.

Automate document version control

Use the equal flag and differing page list to route only changed PDF versions into a manual approval workflow.

Does this tool accept PDF files directly?

No. It accepts text that has already been extracted, organized as one string per page.

What happens if one input is empty?

The request fails with an invalid input error. Each PDF must include at least one page containing non-whitespace extracted text.

Are line wrapping and repeated spaces treated as changes?

No. Runs of whitespace are normalized before page equality is checked, so extraction-only wrapping differences are ignored.

Can it detect visual or formatting differences?

No. It compares extracted text only and does not inspect images, typography, annotations, signatures, metadata, or page geometry.

How are added or removed pages reported?

An unmatched page position is listed as existing only in PDF A or only in PDF B, with its extracted word count.

What does a comparison cost?

Each API request costs $0.002. The deterministic browser implementation can also run without a network call.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/compare-text

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/pdf/compare-text \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pages_a":["Quarterly report\nRevenue was $2.4 million.","Operating expenses were $1.1 million."],"pages_b":["Quarterly report\nRevenue was $2.7 million.","Operating expenses were $1.1 million."]}'
{
  "pages_a": [
    "Quarterly report\nRevenue was $2.4 million.",
    "Operating expenses were $1.1 million."
  ],
  "pages_b": [
    "Quarterly report\nRevenue was $2.7 million.",
    "Operating expenses were $1.1 million."
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.compare_text",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →