# Diff Checker - Compare Two Texts, Line by Line

Page: https://hirantha.me/tools/diff-checker
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-07-31

Compare two blocks of text and see what changed, line by line.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Paste two blocks of text to see exactly which lines were added, removed, or left unchanged between them, entirely in your browser.

The two texts are split into lines and compared using a longest-common-subsequence algorithm, the same underlying approach the Unix diff utility and most version control tools use.

Lines that appear in both texts in the same relative order are matched as unchanged; everything else is marked as either removed from the first text or added in the second.

The comparison is line-based, not character-based, so a single changed word shows its whole line as changed rather than highlighting just that word.

Q: Is my text uploaded anywhere?
A: No, the comparison runs entirely in your browser tab.

Q: Does this highlight word-level changes within a line?
A: No, the comparison is line-based - a line with any change is shown as a full removal and addition rather than a partial highlight.

Q: Does line order matter?
A: Yes - moving a block of lines to a different position shows as a removal in the old location and an addition in the new one.

Q: Is there a size limit?
A: No fixed limit, though very large documents (tens of thousands of lines) may take a moment since the comparison runs on the main thread.

Q: Does this work for code as well as prose?
A: Yes. The comparison is line by line, which is exactly how code diffs work, but it's equally useful for contract revisions or draft copy.

Q: Can I compare two files instead of pasting text?
A: Paste the contents in. Keeping it to text avoids reading your files at all, which is consistent with how every tool here works.

Q: Does it ignore whitespace differences?
A: No, whitespace counts. A line that differs only in indentation or a trailing space is reported as changed, because sometimes that's exactly the difference that matters.

Q: Is this the same as git diff?
A: Same idea, different scope. git diff compares tracked file versions in a repository; this compares two blocks of text you paste, with no repository involved.

Sources: Diff - Wikipedia (https://en.wikipedia.org/wiki/Diff); Longest common subsequence problem - Wikipedia (https://en.wikipedia.org/wiki/Longest_common_subsequence)

Related tools:

- [JSON formatter & validator](https://hirantha.me/tools/json-formatter.md): Pretty-print, minify, and validate JSON with clear error locations.
- [Regex tester](https://hirantha.me/tools/regex-tester.md): Test a regular expression against sample text and see every match.
- [Find and replace text](https://hirantha.me/tools/find-and-replace-text.md): Find and replace in pasted text with plain or regular expression matching, whole word and case options, several rules in order, a live match count and undo.
- [Remove duplicate lines](https://hirantha.me/tools/remove-duplicate-lines.md): Remove duplicate lines from a list and see how many were removed. Keep the first or last copy, ignore case or spaces, or show only the repeated or only the unique lines.
- [Sort lines (A to Z, numeric, shuffle)](https://hirantha.me/tools/sort-lines-tool.md): Sort lines A to Z, Z to A, by number or by length, or reverse and shuffle them. Natural number order, case options and language-aware sorting, live as you type.
