Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

Text & Code Diff Checker

Ignore
Original

Paste the original text, or

Changed

Paste the changed text, or

Differences
Ready
Runs in your browser. Nothing you paste is uploaded unless you share it.

Compare two texts or code files side by side or inline, changed words marked

Find the differences between two versions of a text, config or code file. Changed lines are paired and the changed words highlighted.

How to use it

  1. Paste the original on the left and the changed version on the right, or open files.
  2. Pick Side by side or Inline, and Words, Characters or Smart (words, marking only the part of a word that changed); press Spaces, Case or Blank lines to ignore those changes, or type a pattern under Ignore matches of to leave out timestamps or IDs.
  3. Read the result: removed lines are red, added lines green, changed words stand out within a line. Side by side, → and ← copy a block of changes to the other text. Copy patch gives the differences as a unified diff.

Example

A changed line

Input
Original: const PORT = 3000;
Changed:  const PORT = process.env.PORT ?? 3000;
Result
- const PORT = 3000;
+ const PORT = process.env.PORT ?? 3000;

Only "process.env.PORT ??" is highlighted inside the line.

Options explained

  • Words or Characters: what a changed line marks. Words suits text and most code; Characters finds a single changed letter, digit or quote, as in color → color.
  • Ignore Spaces: lines that differ only in spaces, tabs or indentation count as equal. Useful after reformatting.
  • Ignore Case: "Error" and "error" count as equal.
  • Ignore Blank lines: empty lines are left out of the comparison; each line keeps its own number, so the gap shows where one was.
  • Highlight colors the code on both sides. Auto reads the original and picks JSON, HTML or XML, SQL, CSS, YAML or code; pick one yourself, or None.
  • Unchanged stretches fold to 3 lines of context around each change; the “unchanged lines” row shows them all.
  • Windows (CRLF) and Unix (LF) line endings count as the same line; a note says when the two texts use different ones.

Copy the differences as a patch

Copy patch writes the differences as a unified diff: two header lines naming the original and the changed text, then a hunk per group of changes with 3 lines of context, as diff -u and git diff write them.

The patch needs every line, so it is not offered while Ignore Blank lines is on. With Ignore Spaces or Case on, it holds the changes the page shows, and the unchanged lines as the original has them.

For the sample, Copy patch gives this:

--- Original
+++ Changed
@@ -1,9 +1,11 @@
 const express = require('express');
 const app = express();
+app.use(express.json());
 
 app.get('/users/:id', async (req, res) => {
-  const user = await db.users.find(req.params.id);
+  const user = await db.users.findById(req.params.id);
+  if (!user) return res.status(404).json({ error: 'Not found' });
   res.json(user);
 });
 
-app.listen(3000);
\ No newline at end of file
+app.listen(process.env.PORT || 3000);
\ No newline at end of file

Comparing JSON?

Use the JSON Compare tool instead: it ignores key order and formatting and lists each change with its path, which a line diff can’t do.

Questions

Is my text uploaded or saved?
No. Everything runs in your browser, so your text stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. We don’t save or log what you paste. Recent work keeps your last diffs in this browser; turn it off in Settings.
Why is every line marked as changed?
Usually the indentation changed: tabs against spaces, or the whole file re-indented. Press Spaces to ignore it. Windows and Unix line endings are already read as the same.
How big can the texts be?
Up to 10 MB for the two together. The diff runs off the main thread, and very long results are shown up to a limit with the totals kept exact.
Can I ignore timestamps, IDs or other text that always differs?
Yes: type a JavaScript regular expression under Ignore matches of, such as \d{4}-\d\d-\d\dT[\d:]+Z for ISO times. Its matches are left out of the comparison, so lines that differ only there count as the same, and the words inside a match are not marked.
Can I merge changes from one side into the other?
Yes, side by side: the first line of each block of changes has an arrow. → copies that block from the original into the changed text, ← the other way; the texts update and the comparison runs again. Line endings stay those of the text that changes.
What algorithm is used?
A line diff based on the Myers algorithm (the same idea as git diff), followed by a word or character diff on each changed line pair.
Can I get the differences as a patch file?
Yes: Copy patch copies a unified diff, as diff -u and git diff write it. Save it as a .patch file and apply it to the original with patch, naming the file: patch notes.txt changes.patch.

Related tools