Text Diff Tool

Paste two versions of text and see the differences highlighted line by line. Added lines appear in green, removed in red. Copy the result as a patch file.

Diff

Enter text in either pane to see the diff.

Advertisement

Frequently Asked Questions

What algorithm does this tool use?

This tool uses the Myers diff algorithm via the diff npm package — the same algorithm used by Git. It finds the minimal edit distance between two texts.

What is the patch format?

The copied patch uses the unified diff format — the same format produced by git diff. It includes file headers and @@ hunk markers, so it can be applied directly with git apply or the patch command.

Does this work with code?

Yes. This tool compares any plain text line by line, so it works well for code, prose, configuration files, or any text you want to diff.

Is my text sent to any server?

No. The diff is computed entirely in your browser using JavaScript. Nothing is sent to any server.