A line diff, not a word diff
Compare two texts by line
Two copies of a list or a config rarely differ in every line. This page marks lines that only the first text has and lines that only the second text has.
Each side is split on newlines. Matching lines are kept in order, and the marks follow a longest-common-subsequence diff. A changed line appears as a removal plus an addition. The page does not ignore spaces, and it does not compare inside a line. Each side is limited to 400 lines.
Both texts stay in this tab.
This tool runs in your browser. Turn on JavaScript to use it.
One changed line
The shared line stays. The other line is a removal and an addition.
- Left
- a b
- Right
- a c
- Marks
- same a, remove b, add c
How to use it
- 1Paste the older text on the left.
- 2Paste the newer text on the right.
- 3Compare. Removed lines and added lines are marked.
Good to know
- Line by line, not word by word.
- Spaces matter.
- Each side can be up to 400 lines.
Questions
Why is an edit shown as two lines?
A changed line is not the same line. It is removed from the left and added on the right.
Can I ignore whitespace?
No. Trim the lines on the line page first if that is what you want.
Does this create a patch file?
No. It shows the rows. It does not write a unified diff header.
Related tools
- Sort, trim, and count lines
Lists in a text box are awkward to clean by hand. This page trims, filters, sorts, or reverses the lines, and always shows the counts.
- Format and check JSON
JSON is a data format with strict commas, quotes, and no comments. This page parses what you paste and prints it again with an indent, or on one line.
- Test a JavaScript regular expression
Regular expressions in JavaScript are not the same as PCRE or .NET. This page uses the RegExp your browser already ships, so a match here is a match in frontend code.