What this tool does
Compares two versions of text or source code and displays additions, removals and paired changed lines with original line numbers.
How to use it
- Paste the original into Left text and the revised version into Right text.
- Choose whether to ignore case or whitespace, then compare.
- Switch between side-by-side and inline views, show nearby context, or copy the text report.
Worked example
Left ‘const total = 2;’ and right ‘const total = 3;’ produce one removed line and one added line, paired as one replacement. The highlight isolates the changed 2 and 3.
Processing and explanation
A longest common subsequence aligns unchanged lines. Consecutive removed and added lines are paired for readability; highlights show a contiguous changed span within each pair. CRLF and CR line endings normalize to LF. Ignoring whitespace removes all whitespace within each line for comparison, while displayed source text stays intact.
Limits and common mistakes
100,000 UTF-16 code units and 2,000 lines per side. After trimming shared prefix/suffix lines, extensive changes are limited to 2 million comparison cells. This compares text rather than programming-language behavior. The copied report is not an apply-ready Git patch. A trailing newline is represented as a final empty line.
Privacy and your input
Inputs and results stay in this browser tab. This tool does not upload them, put them in URLs or browser storage, or include them in analytics. Clipboard copies are managed by your browser and operating system.
Frequently asked questions
- Will this change my code?
- No. Source fields remain separate from the comparison output.
- What does ignore whitespace do?
- It ignores spaces, tabs and other whitespace inside each line; it still compares line boundaries.
- Does a replacement count twice?
- Yes. It contributes one removed line and one added line, with a paired changed row in the view.
Material content update: