The comparison is line based and does not detect moved blocks or word-level edits inside a changed line. Inputs and results remain in this browser tab.
How to use this text diff checker
- Paste the original and changed text into the two editors.
- Choose whether letter case or whitespace amount should be ignored, then compare.
- Review line numbers and highlighted changes, or copy and download the unified diff.
Compare two texts line by line
Paste an earlier version on the left and a revised version on the right, then select Compare text. The result aligns matching lines and marks every removal with a minus and every addition with a plus. Original and changed line numbers stay visible beside each row, making the output useful for source code, configuration, logs, documentation and ordinary prose. Unchanged lines provide context around each edit instead of disappearing.
How the line-diff calculation works
The checker finds a longest common subsequence of normalized lines. That means it preserves the largest ordered set of lines shared by both inputs, then reports the remaining left-side lines as removed and right-side lines as added. A changed line is represented as one removal followed by one addition, matching the convention used by unified diff files. When two repeated lines could align in more than one valid way, the tool chooses a deterministic alignment; another diff program can show a slightly different but equivalent grouping.
Worked configuration example
If an original server configuration contains port 8080 and log info, while the changed version contains port 8081, log warn and a new cache on line, the result reports two removed lines and three added lines. The surrounding braces remain unchanged. Copy unified diff produces plain text beginning with --- original and +++ changed, followed by space, minus and plus prefixes.
Ignore whitespace or letter case
Ignore whitespace trims the start and end of each line and collapses consecutive spaces, tabs and other whitespace to one space before matching. The displayed text is not rewritten. Ignore letter case compares a lowercase form of each line using a stable English locale. These options can hide formatting-only or capitalization-only changes, so leave them off when exact bytes, indentation or identifiers matter.
Text diff versus JSON diff
This tool treats every input as plain text and line order as meaningful. Use the JSON Diff when object-key order and formatting should be ignored and changes need JSON Pointer paths or an RFC 6902 patch. Use the JSON Formatter to validate one JSON document, or the Regex Tester to search both versions for a particular pattern.
Privacy and browser limits
Comparison runs locally in the current browser tab. Code Compass does not submit pasted text to its server. Each side is limited to one million characters and 5,000 lines, and the alignment matrix is capped to protect phones and older browsers from an unresponsive page. A very large or heavily rewritten pair can therefore be rejected even when each text is under the character limit. Compare smaller sections or use a local version-control client for large repositories.
What the result does not prove
A line diff shows textual changes; it does not determine whether code is correct, safe or semantically equivalent. It does not detect moved blocks, rename symbols, parse programming languages or review binary files. The similarity percentage is the number of aligned lines divided by the larger line count, not a plagiarism, authorship or quality score. Review important changes in their real execution and security context.
Frequently asked questions
Does the checker upload my text?
No. Inputs, comparison results and the downloaded diff are produced locally in this browser tab.
Can I compare source code?
Yes. Paste any plain-text language or configuration. Syntax highlighting and language-aware analysis are outside this tool’s scope.
Why is one changed line shown twice?
A conventional line diff represents replacement as removal of the old line and addition of the new line.