Free tool
Text Diff Checker
Compare two versions of a text line by line, with added and removed lines highlighted and counted.
How it works
What is the Text Diff Checker?
The Text Diff Checker is a free tool that compares two versions of a text line by line. Paste the original and the changed version, and it highlights lines that were added in green and removed in red, counts each, and tells you if the two are identical. Options ignore whitespace and letter case.
How to use the Text Diff Checker
- Paste the first version into Original text and the second into Changed text.
- Tick Ignore whitespace differences or Ignore case if those should not count.
- Read the counts, then scan the green and red lines in the diff.
- Press Copy diff to take the result as plain text with + and - markers.
What is a diff checker?
A diff checker compares two pieces of text and reports what differs between them. The name comes from the Unix diff program, which has done this for source code since the 1970s.
This tool works on lines. It shows every line of the changed text in order, with lines that exist only in the original marked - and lines that exist only in the changed text marked +. Unchanged lines are shown plain so you keep the context.
How does a line-by-line diff work?
It finds the longest common subsequence of the two texts: the largest set of lines that appear in both, in the same order. Those lines are the unchanged ones. Everything in the original that is not part of that set was removed, and everything in the new version that is not part of it was added.
A line that was edited does not match its old self, so it appears as one removed line followed by one added line. The tool does not highlight the changed words inside a line.
How do I compare two texts and ignore formatting changes?
Tick Ignore whitespace differences. Lines are then compared after trimming the ends and collapsing runs of spaces and tabs to one space, so re-indented code or text with trailing spaces counts as unchanged. Ignore case does the same for capitals.
Both options affect only the comparison. The diff still shows the text from the changed version exactly as you pasted it. Windows and Unix line endings are always treated as the same.
What can I use a text diff for?
Anything with two versions. Checking what an editor changed in a draft. Comparing a config file before and after a deploy. Seeing what a rewrite tool actually did to your copy. Confirming that two exports that should match really do: if the result says Identical, they are the same line for line.
For prose, a line is a paragraph, so one changed word marks the whole paragraph. Put each sentence on its own line first if you need finer detail.
How do I compare JSON, HTML or other code?
Normalize both sides first, or formatting noise will hide the real changes. Run each JSON file through the JSON Formatter with the same indentation, then paste the two results here. A diff of minified code is close to useless, because the whole file is one line.
There is a size ceiling. The comparison builds a table in memory, and when the changed regions of the two texts are both several thousand lines long, the tool stops and asks you to trim the input. To review the robots.txt file of a live site, not a pasted copy, use the Robots.txt Checker.
Questions
- Does the diff show changes inside a line?
- No. It compares whole lines. An edited line appears as a removed line and an added line next to each other.
- What do the + and - signs mean?
- A
+line exists only in the changed text, so it was added. A-line exists only in the original, so it was removed. Lines with no sign are the same in both. - Does the order of the two boxes matter?
- Only for the labels. Swapping the texts turns every added line into a removed one and the reverse. The set of differing lines is the same.
- Can I compare Word or PDF documents?
- Not directly. Copy the text out of each document and paste it in. Formatting such as bold, fonts and images is not compared.
- Is the Text Diff Checker free?
- Yes, with a free spyc.ai account. It runs in your browser, so nothing you type or paste is sent to a server.
Developer Tools
More in Developer Tools
JSON Formatter
Format, minify and validate JSON in your browser, with the line and column of the first syntax error.
Format JSONJSON-LD Formatter
Pretty-print JSON-LD pasted bare or in script tags, list every @type and flag a missing @context.
Format JSON-LDCase Converter
Convert text to upper, lower, title or sentence case, or to camelCase, PascalCase, snake_case and kebab-case.
Convert caseReady when you are
Before your next buyer asks AI about you, ask AI about yourself
One check, four engines, about twenty seconds. We show you the answers before we ask for anything.