Text Diff Checker Online

Compare two texts line-by-line and see additions and removals in your browser. Your text stays on your device.

Both texts are compared locally in your browser, and nothing is uploaded to a server.

Built and maintained by Udit Agarwal

Text Diff, Explained

Comparing two PDFs instead? Try the Compare PDFs tool.

About Text Diff

This text diff checker compares two blocks of text line by line and highlights exactly what changed between them. Paste an original and a modified version, and it marks each added and removed line and shows a running count of additions and removals. It is a fast way to compare text online when reviewing config edits, comparing log output, spotting changes between two copies of a document, or sanity-checking a paste before you commit it. Built for developers, QA engineers, and technical writers who need a quick text comparison tool to compare two texts. The comparison uses a longest-common-subsequence algorithm to keep matching lines aligned, and everything is processed locally in your browser, so the text you compare never leaves your device.

Features

  • Line-based comparison using a longest-common-subsequence algorithm
  • Highlights added and removed lines in distinct colors
  • Shows a live count of additions and removals
  • Keeps unchanged lines aligned for easy scanning
  • Handles multi-line text blocks pasted from anywhere
  • Updates the diff instantly as you edit either side
  • Pauses automatically on very large inputs (over 2000 lines) to stay responsive
  • Runs entirely in your browser, so your data never leaves your device

How to use the Text Diff

  1. Paste your original text into the left input box.
  2. Paste the updated text into the right input box.
  3. Read the diff output to see added lines, removed lines, and the change counts.
  4. Edit either side and watch the comparison update.

Example

Input

apple
banana
cherry

Output

  apple
- banana
+ blueberry
  cherry

One line removed and one added; matching lines stay aligned.

Common errors & troubleshooting

  • A single edited word shows the whole line as both removed and added. — The diff is line-based, not word-based, so any change within a line replaces that entire line in the output.
  • The diff seems to pause or stop on huge inputs. — Inputs over 2000 lines are paused to keep the page responsive; compare smaller sections to see the full result.
  • Identical-looking lines are flagged as different. — Lines are compared exactly, so a trailing space or a tab in place of spaces counts as a change. A line break at the end of only one side also adds an empty line to the diff.
  • Reordered lines show up as both removed and added rather than moved. — A line-based diff has no concept of a move, so a relocated line appears as a removal in one spot and an addition in another.

Frequently asked questions

What is the Text Diff checker?
It is an online tool that compares two blocks of text line by line, highlighting added and removed lines so you can see exactly what changed between two versions.
How do I compare two texts with Text Diff?
Paste your original text on the left and the updated text on the right; the tool aligns matching lines and highlights the differences automatically as you type.
Is the Text Diff tool line-based or word-based?
It is line-based and uses a longest-common-subsequence algorithm to align matching lines and highlight added and removed ones.
Is there a size limit on the text I can compare?
Very large inputs over 2000 lines are paused to keep the page responsive, so split large files into smaller chunks if needed.
Can I compare code or config files with Text Diff?
Yes, paste either version as plain text and the tool will highlight the differing lines, which makes it handy for config edits and log output.
Is the text I compare in Text Diff sent anywhere?
No. The Text Diff comparison runs entirely in your browser and the text you paste never leaves your device.

Related tools

Guides

More Code Formatters tools

  • MDX Converter — Render MDX as formatted text, convert HTML → MDX, and escape text to literal MDX.
  • CSS / SCSS Formatter — Beautify or minify CSS/SCSS/LESS, sort properties and remove duplicates.
  • JS / TS Formatter — Beautify JavaScript, TypeScript and JSX/TSX with Prettier options, or minify plain JavaScript.
  • HTML Formatter — Beautify or minify HTML, format inline CSS/JS, and preview the result.
  • XML Formatter — Beautify, minify and validate XML, and convert XML ↔ JSON.
  • SQL Formatter — Format SQL for MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and Oracle.
  • GraphQL Formatter — Format or minify GraphQL queries and schemas, validate syntax and extract operations.
  • Dockerfile Formatter — Format a Dockerfile and get best-practice / lint suggestions.
  • MongoDB Query Formatter — Format MongoDB shell queries and aggregation pipelines.
  • Contrast Checker — Check WCAG colour contrast ratio and AA/AAA pass for any two colours.
  • Mermaid Diagram Renderer — Render Mermaid diagrams (flowcharts, sequence, gantt) to SVG in your browser.
  • SVG Optimizer — Minify SVG — strip comments, metadata and editor cruft, and collapse whitespace.

See all Code Formatters tools (32) · All tools