Compare two versions of a document and see exactly what changed — every word, side by side. Works with PDF, Word (.docx), OpenDocument (.odt), plain text and Markdown, in any combination.
Nothing you open leaves your device. No server, no upload, no account, no network request of any kind. The whole tool is a folder of static files that runs inside your browser tab — which is what makes it usable for the documents you are not allowed to send anywhere.
Try it without installing anything →
git clone https://github.com/niklasjosq/opendiff.git
cd opendiff
./start.shThat is the whole installation. There is nothing to build, nothing to npm install, and no dependency to download — the repository is the program.
start.sh starts a small web server on your own machine, on 127.0.0.1 so
nothing else on the network can reach it, and opens the app. If you have Chrome,
Edge or Brave it opens in a clean app window with no tabs or address bar.
You need either python3 or node — almost every machine has one already
(macOS and Linux ship python3) — and a current browser.
The app itself is a web page, so it runs anywhere a modern browser does: macOS, Windows, Linux and ChromeOS, and on tablets and phones (workable, though two columns of contract on a phone is not a pleasure). The only real requirement is the browser version:
| Minimum | Why | |
|---|---|---|
| Chrome, Edge, Brave, Opera | 92 | DecompressionStream, for reading .docx and .odt |
| Firefox | 114 | as above, plus module workers |
| Safari | 16.4 | DecompressionStream arrived late here |
The launcher is the only part that cares which operating system you are on:
./start.sh |
Redline.command |
Run the server directly | |
|---|---|---|---|
| macOS | yes | yes (double-click) | yes |
| Linux | yes | — | yes |
| Windows | in Git Bash or WSL | — | yes — see below |
To stop it: Ctrl-C in the terminal. The server disappears with it.
Useful variations:
./start.sh --no-browser # just serve; print the URL and let you open it
PORT=9000 ./start.sh # start looking for a free port at 9000
./start.sh --helpDouble-click Redline.command in Finder — same thing, no terminal needed.
The first time, macOS may ask you to confirm; right-click → Open if it does.
start.sh is a shell script, so run the server directly instead:
python scripts/serve.pyor, if you have Node rather than Python:
node scripts/serve.mjsEither prints a http://127.0.0.1:… address — open it in your browser. (In Git
Bash or WSL, ./start.sh works as it does everywhere else.)
Because browsers refuse to load ES modules and web workers from file:// URLs,
so the page would come up blank. That is the only reason there is a
one-command server instead of a file to double-click.
Open the app in Chrome, Edge or Brave and click Install in the address bar — or ⋮ → Cast, save and share → Install page as app. You get a windowed application with its own icon in your launcher.
Once installed it works with the network switched off, because a service worker keeps every file it needs on your machine. You can install from the hosted link and never load it from the internet again.
To remove it: chrome://apps → right-click → Remove.
- Drop two documents into the two panels — the original on the left, the revised version on the right. Or click a panel to browse for a file. The format is detected from the file's contents, not its name.
- Press Compare. Everything happens on your machine; a long document takes a moment.
- Read the redline. Deleted text is struck through in red on the left, inserted text is underlined in green on the right. Scrolling one side scrolls the other to the matching place.
- Work through the change list on the left: numbered, labelled Added, Deleted or Changed, and located by paragraph or page. Click one to jump to it.
- Export a report when you are done — a single marked-up document with the change list, opened in a new tab. Use your browser's Print command and choose Save as PDF to keep or send it. (It is printed by your browser; nothing is uploaded.)
Text reflows both documents into readable columns, and works for any pair of formats. Pages appears when both sides are PDFs and shows the changes highlighted on the real pages, where they sit in the signed copy — the view you want when someone says "look at page 14".
| Key | Does |
|---|---|
j or n |
Next change |
k or p |
Previous change |
+ / - |
Zoom in / out (75–200%) |
0 |
Reset zoom |
Esc |
Close an error message |
| Format | Read | Worth knowing |
|---|---|---|
.pdf |
yes | The text layer only. Scans are detected and reported, never OCR'd. |
.docx |
yes | Tracked changes are shown as if accepted; tables and text boxes are read in reading order. |
.odt |
yes | Same tracked-changes policy as .docx. |
.txt |
yes | Paragraphs split on blank lines. UTF-8 and UTF-16. |
.md |
yes | Compared as raw source — **bold** is text, and a change to it is a change. |
.doc, .rtf, .pages |
no | Save as .docx first. The app tells you so when you try. |
.xlsx, .pptx, .ods |
no | Not text documents. |
Any format can be compared against any other, because only the text is compared.
Worth knowing before you rely on it:
- Read a scanned PDF. A scan is a picture of text. redline detects that there is no text layer and says so, rather than showing an empty comparison — but there is no OCR.
- Compare formatting. Styles, colours, fonts, images, headers, footers, footnotes and comments are not compared. Two documents that differ only in font come out identical.
- Notice that a clause moved. A move reads as a deletion in one place and an insertion in another, because that is what a minimal edit script contains.
- Open a password-protected file. Remove the password first; there is no decryption here.
- Show tracked changes as changes. A document that still carries revision marks is compared as if every change had been accepted, and the app says which side had them.
- Handle everything a PDF can contain. A PDF stores glyphs at coordinates, not paragraphs, so multi-column layouts, tables and text in figures can come out in an order the eye would not choose. PDFs relying on predefined CJK encodings may be garbled: the character maps are ~1.6 MB and are deliberately not shipped.
- Compare enormous files. Above 100 MB it refuses outright; two book-length documents will take a few seconds and a lot of memory.
Where text is dropped because it sits in a part redline cannot read — a chart, an embedded object — it says so rather than leaving a silent hole in the comparison.
This is the whole point, so it is worth being precise.
- No uploads. Files are read by the browser and stay in the tab's memory. Nothing is sent anywhere. Closing the tab is all the cleanup there is.
- No network. After the page has loaded, the app makes no requests at all — not for fonts, not for analytics, not for error reporting. There is no telemetry and no third-party script; pdf.js is vendored into this repository rather than loaded from a CDN.
- No storage. Nothing is written to disk, to local storage or to a database. The service worker caches the application's own files — never your documents.
- Check it yourself. Open DevTools → Network, compare two documents, and watch: after the page loads, nothing. Or switch the network off and use it anyway.
- The hosted copy is served by GitHub Pages, which sees that you requested
the page, as any website would. Your documents are not part of that. If even
the page request should stay on your network, clone the repository and run
./start.sh— that is exactly why it exists.
| What you see | What to do |
|---|---|
./start.sh: Permission denied |
Run sh start.sh (the executable bit is lost when you download a ZIP instead of cloning). |
needs python3 or node, and found neither |
Install either. On macOS, xcode-select --install brings python3. |
| The browser did not open | The terminal prints the address — open it yourself. |
| Port already in use | PORT=9000 ./start.sh. |
| A blank page | You opened index.html directly. Use ./start.sh. |
| "This looks like a legacy .doc file…" | It is a .doc, or password-protected. Open it in Word or LibreOffice and save as .docx. |
| "no text layer — most likely a scan" | It is a scan. There is nothing to compare; redline has no OCR. |
| The report did not open | Your browser blocked the pop-up. Allow pop-ups for the page and export again. |
| The installed app looks out of date | Reload it (Ctrl/Cmd + Shift + R). It updates itself on the next load after a new version is published. |
| A PDF comparison looks scrambled | Probably a multi-column layout — see What it will not do. Compare the Word originals if you have them. |
Anything else — especially a comparison that disagrees with what Word or Acrobat shows you — is a bug worth reporting. See SECURITY.md if it looks like a document could hide a change from a reader.
index.html ──► src/app.js intake → detect → extract → diff → render
├─ detect.js magic bytes → pdf / zip / ole2 / text
├─ zip.js minimal ZIP reader (DecompressionStream)
├─ extractors/ pdf · docx · odt · text → one word stream each
├─ diff.js linear-space Myers word diff (runs in a worker)
├─ render-*.js flowed columns, or PDF pages on canvas
└─ report.js printable merged redline
Every extractor produces the same thing — a list of words, each knowing its
paragraph and, for PDFs, its box on the page — which is why any format can be
compared with any other. No build step, no bundler, no dependencies;
vendor/pdfjs holds a copy of pdf.js, and
vendor/pdfjs/README.md records exactly which files and
why.
Running the tests, changing the code, adding a format: CONTRIBUTING.md.
node --test test/*.test.js # unit tests, no browser needed
node test/fixtures/generate.js # sample documents to try it on
node scripts/smoke.mjs test/browser/*.mjs # end-to-end, in headless ChromeApache-2.0 — use it, change it, ship it. pdf.js is Apache-2.0 as well; its licence travels with the vendored copy.
Made by Hegemann Technologies. Brand assets and how to update them: brand/README.md.

