# Text Diff Checker

> A diff checker compares two pieces of text line by line and highlights exactly what was added and removed. It uses a longest-common-subsequence algorithm - the same approach git uses - so unchanged lines stay aligned instead of everything after one edit appearing as changed.

Source: https://rankcert.com/tools/diff-checker
Free, no signup. Updated: 2026-09-02

## How to use it

1. Paste the original text on the left.
2. Paste the changed version on the right.
3. Read the highlighted result - green is added, red is removed.

## Questions

### How do I compare two documents for differences?

Paste both versions here. For Word documents, use Review then Compare, which understands formatting changes as well as text.

### Is my text uploaded to compare it?

No. The comparison runs in JavaScript on this page, which matters when the two versions are contract drafts or config files.

### What does the diff algorithm actually do?

It finds the longest sequence of lines common to both texts and treats everything else as an insertion or deletion. That is why inserting one line at the top does not mark the whole file as changed.

### Can it compare word by word instead of line by line?

This one works on lines, which is the right granularity for code, config and structured text. For prose where you want word-level detail, paste one sentence per line first.

### How do I diff two files from the terminal?

diff -u old new for a unified diff, or git diff --no-index old new to get git's colouring and formatting on files outside a repository.

### Why do two identical-looking lines show as different?

Almost always trailing whitespace or line endings - a file saved on Windows uses CRLF and one saved on macOS uses LF. Both are invisible and both count.

### How large a text can it handle?

Comfortably a few thousand lines. The comparison is quadratic in the number of lines, so very large files will slow the page down.

### Can I compare JSON?

Yes, but format both sides first so keys line up on their own lines. Comparing minified JSON produces one enormous changed line.

## Related tools

- [JWT Decoder](https://rankcert.com/tools/jwt-decoder): Paste a JSON Web Token to decode its header and payload and read every claim, including expiry. Runs entirely in your browser.
- [JSON Formatter](https://rankcert.com/tools/json-formatter): Format, validate and minify JSON in your browser. Get the exact line and column of a syntax error instead of a vague parse failure.
- [UUID Generator](https://rankcert.com/tools/uuid-generator): Generate cryptographically random UUID v4s, or time-ordered UUID v7s that index far better as database primary keys.
- [Regex Tester](https://rankcert.com/tools/regex-tester): Test a JavaScript regular expression against sample text, see every match with its position and capture groups, and get real errors for invalid patterns.
- [Base64 Encode / Decode](https://rankcert.com/tools/base64-encode-decode): Encode text to base64 or decode it back, with full UTF-8 support and automatic handling of base64url input. Runs entirely in your browser.
- [Wildcard Mask Calculator](https://rankcert.com/tools/wildcard-mask-calculator): Convert a CIDR prefix or subnet into the wildcard mask Cisco ACLs and OSPF network statements expect, with the subnet mask and address range alongside it.