Paste your original and changed text to see exactly what was added, removed, or left unchanged.
This tool compares two pieces of text line by line using a longest common subsequence (LCS) algorithm and highlights exactly what changed. It's useful for reviewing edits to documents, comparing code snippets, or checking configuration files before and after a change.
How does the diff algorithm work?
This tool finds the longest common subsequence (LCS) of lines between the two texts, then marks any line that isn't part of that shared sequence as added or removed.
What does 'ignore trailing whitespace' do?
It strips spaces and tabs from the end of each line before comparing, so differences that are only whitespace at line endings won't be reported as changes.
Is there a size limit on the text I can compare?
Each box accepts up to 500,000 characters. Very large inputs automatically fall back to a faster comparison method so the tool stays responsive.
What's the difference between unified and side-by-side view?
Unified view shows one column with added and removed lines marked by + and - prefixes, similar to a git diff. Side-by-side view shows the original and changed text in two aligned columns, which can be easier to scan for larger changes.
Can I copy the diff output?
Yes — use the copy button above the unified view to copy the diff in unified diff format, ready to paste into a text file, issue, or code review comment.
Does the diff work for code as well as prose?
Yes. Since the comparison is line-based rather than tied to any specific language, it works equally well for source code, configuration files, JSON, markdown, or plain prose.
Both texts are compared entirely in your browser using JavaScript. Nothing is uploaded, transmitted, or stored anywhere.