Free plan

Compare Documents

See what changed between two versions of a document
POST
/v1/documents/compare

About this tool

This tool reads the words of two documents and shows what was added and what was removed. It works with Word, PDF, Excel and text files, and you can mix types. You get a similarity score (how alike the two are), a list of changes and a marked-up page. You can ignore capital letters, and choose to compare whole paragraphs or single words.
For example, you receive a revised contract and want to see exactly which sentences your colleague changed.

How to use it

  1. Choose this tool.
  2. Add the original document in the first box and the revised one in the second box.
  3. Choose whether to compare single words or whole paragraphs, and whether capital letters should count.
  4. Press Generate.
  5. Read the result on screen or download the marked-up page.

What you get back

You get the list of changes and a similarity score on screen. You can also download a web page where new text is green and removed text is red.
GOOD TO KNOW
The words are compared, not the layout, fonts or pictures. A scanned document has no text: run OCR first. Counts as two documents.
TEST IT LIVE

Try Compare Documents in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/compare
Tool ID
documents.compare
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/compare" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'other=@document.pdf' \
  -F 'level=word' \
  -F 'ignore_case=false' \
  -F 'response=url'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.compare({
    "file": 'document.pdf',
    "other": 'document.pdf',
    "level": "word",
    "ignore_case": false,
    "response": "url"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->compare([
    'file' => 'document.pdf',
    'other' => 'document.pdf',
    'level' => 'word',
    'ignore_case' => false,
    'response' => 'url',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Compare the words of two documents of any type (Word, PDF, Excel, text …): what was added and removed, a similarity score, the list of changes and a redline page.

Compare Documents works from text and settings, so no file is needed. Every input is optional.

Compare Documents is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/compare with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.