Text Diff Checker
Compare two blocks of text.
Compare two blocks of text.
How to use Text Diff Checker
- Paste the original version into the left box
- Paste the changed version into the right box
- Read the green additions and red removals with change counts
About Text Diff Checker
Text Diff Checker takes two blocks of text and shows you, line by line, exactly what changed. Paste the original version on the left and the revised version on the right, and it highlights added lines in green with a plus, removed lines in red with a minus, and leaves unchanged lines neutral, the same style you see in a git diff. It also tallies how many lines were added, removed, and left untouched, so you get a quick summary of the difference.
Because the comparison is line-based and works on any plain text, you can use it as a code diff checker, a JSON diff checker, or to compare XML, HTML, CSV, config files, essays, and logs. Paste the contents of two files to spot every changed line between them. It compares the raw text you paste rather than parsing structure or reading PDF files, which keeps it fast and predictable. The "ignore leading and trailing whitespace" option lets you skip differences that are only re-indented spaces or tabs.
Everything runs in your browser using a built-in Longest Common Subsequence (LCS) diff algorithm, with no sign-up, no limits, and no watermarks. The text you paste never leaves your device or gets uploaded to a server, so it is safe for private code or sensitive documents.
Frequently asked questions
- Is the Text Diff Checker free to use?
- Yes, it is 100% free with no account, no sign-up, and no usage limits. You can compare as many texts as you want, as often as you want.
- Is my data uploaded anywhere when I compare text?
- No. The entire diff is computed locally in your browser using JavaScript. Nothing you paste is ever sent to a server, stored, or uploaded, so it is safe for private or sensitive text.
- How does the line-by-line diff work?
- It uses a Longest Common Subsequence (LCS) algorithm to find the lines the two versions share, then marks the rest as added or removed. Added lines appear green with a + prefix and removed lines appear red with a - prefix.
- Can I use it as a code diff checker?
- Yes. Paste two versions of a file and it flags every added and removed line, which makes it well suited to source code and structured text. The comparison is line-based, so a line that changes even slightly is shown as removed and re-added.
- Can I use it as a JSON diff checker?
- Yes. Paste your two JSON snippets and it compares them line by line, highlighting anything added or removed. It reads the raw text rather than parsing the structure, so for the cleanest result, format both versions the same way (same indentation and key order) before you paste.
- How do I compare two files?
- Open each file, copy its contents, and paste one version on each side. That works for any text file, including source code, JSON, XML, CSV, HTML, or a config file, and you'll see exactly which lines differ between the two.
- Does it work like a git diff?
- The output uses the same convention as a git diff: added lines are green with a + and removed lines are red with a -. You can paste two versions of a file to preview the changes the way they'd look in a commit, without needing git installed.
- Can I diff XML or HTML?
- Yes. XML and HTML are plain text, so paste both versions and it marks each changed line. Because it compares lines rather than parsing tags, keep the formatting consistent between the two versions so real differences aren't hidden by re-wrapped markup.
- Can I compare two CSV files?
- Yes. Paste each CSV on one side and it shows which rows were added or removed line by line. It's a quick way to compare two exports or spot new and deleted records, as long as the column order matches in both files.
- Can I compare two PDFs?
- Not directly, since the tool compares text you paste rather than PDF files. To compare two PDFs, open each one, copy the text out, and paste one version on each side. The line-by-line diff then works the same as it does for any other text.
- What is the difference between a text diff and a string diff?
- This tool compares text one line at a time rather than character by character, so it is built for multi-line text, code, and files. If two lines differ by even a single character, the whole line is marked as changed.
- What does the 'ignore leading and trailing whitespace' option do?
- When enabled, lines that differ only by spaces or tabs at the start or end are treated as unchanged. This is handy when indentation or trailing spaces were reformatted but the actual content is the same.
- Does it work in dark mode and on mobile?
- Yes. The added and removed highlights use semi-transparent colors that stay readable in both light and dark themes, and the layout is responsive so it works on phones, tablets, and desktops.