Text diff

What is a Text Diff?

A diff shows exactly what changed between two versions of a text: which lines or words were added, removed or modified. Developers use it to review code and configuration changes, writers to compare drafts, and support teams to check whether two log outputs or API responses really differ. This tool compares any two texts in your browser.

How to use it

  1. Paste the original text on the left and the changed text on the right.
  2. Review the highlighted differences: removals and additions are marked in different colours.

Example

Original:

timeout: 30
retries: 3
log_level: info

Changed:

timeout: 60
retries: 3
log_level: debug

The diff shows two changed lines, timeout and log_level, and one unchanged line. In unified diff notation this would appear as -timeout: 30 and +timeout: 60.

How diffs are computed

Diff algorithms, such as the Myers algorithm used by Git, find the longest common subsequence of the two texts and report everything else as insertions and deletions. That is why a moved paragraph usually appears as one deletion plus one insertion rather than a move.

Tips for cleaner comparisons

  • Normalise whitespace and line endings first. Trailing spaces or CRLF vs. LF differences make every line look changed.
  • Format both sides the same way. Prettify JSON or XML before comparing, or use a JSON-aware diff.
  • Sort lists if order does not matter, such as dependency lists.
  • Nothing is uploaded, so you can compare confidential documents safely.

Frequently Asked Questions

How does text diff work?

It finds the longest common sequence of lines or words between the two texts and marks everything else as added or removed.

Why does every line show as changed?

The texts probably differ in invisible characters such as trailing spaces, tabs versus spaces, or Windows versus Unix line endings.

Can I compare JSON with this tool?

Yes, but format both sides the same way first. For key-order independent comparison, use the JSON diff tool.

Are my texts uploaded?

No. The comparison runs entirely in your browser.