FLXCode Diff Checker

FLXCode apps

Appearance

Diff Checker

Paste two texts and see what changed. They stay in your browser.

Both texts stay in this page. Nothing is saved, shared or sent. Up to 2 MB on each side.

Paste text on both sides to compare it.

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

Problem or idea? Email us

How to use it

  1. Paste the old text on the left and the new text on the right, or choose Open file for each side. Dropping a file on a box works too.
  2. The result appears under the boxes after a short pause. Pick Side by side or Unified.
  3. Press n for the next change and p for the previous one, or use the buttons.
  4. Use the switches to ignore whitespace, case or blank lines. Choose JSON to compare data without caring about key order.
  5. Copy the diff or download it as changes.diff.

What the result looks like

Two small config files, 4 lines each. The page finds 1 changed, 1 added and 1 removed line. As a unified diff it is:

--- old.conf
+++ new.conf
@@ -1,4 +1,4 @@
 name = demo
-port = 3000
-debug = true
+port = 8080
 log = /var/log/app.log
+theme = dark

The example comes from the same function the tool runs. We also test it against GNU patch: on random texts, applying our diff to the left text gives the right text back.

How it works

The lines are compared with the Myers algorithm, which finds the smallest set of added and removed lines (source: Myers, Algorithmica 1986). It is the one behind diff and git. Inside a changed line, the same method runs on words, and on letters when two words are close, so a change like 3000 to 8080 is marked in the number only.

Line endings are read as the same (CRLF, CR and LF). A last line with no line break is different from the same line with one, and the page says so, as diff does. Inputs with a lot of difference are split at a time cap, so the result is valid but can be a bit longer than the shortest one.

Limits

  • Text only, up to 2 MB on each side. No folders, no Word or PDF files, no images. For a PDF, copy the text out first.
  • Two sides only. No three-way merge and no editing of the result.
  • Moved blocks are shown as removed in one place and added in another. The page does not detect moves.
  • The result shows 3,000 rows first. A button shows more. Long runs of unchanged lines are folded into a button.
  • JSON mode uses the JSON formatter reader. For checking one JSON text, use that page. To test a pattern before a search, use the regex tester.

What happens to your text

Nothing leaves this tab. Small comparisons run on the page, big ones in a background worker from this site. The texts are not put in the address, not stored and not part of any count. The page remembers only your switches, in this browser. We count events without cookies, such as "diff copied" (details).

FAQ

Is it safe to paste a config file or a key here?

Both texts are handled in this browser tab. They are not uploaded, saved or put in the address, and you can check that by turning off Wi-Fi after the page has loaded. Still, take out passwords and keys you do not need to compare. The page only remembers the switches, never the text.

What does Ignore whitespace do?

It removes all spaces, tabs and line-end differences before two lines are compared, like diff -w. So "a b" and "ab" count as equal. Indentation changes disappear. A missing line break at the end of the file is also ignored.

How are lines paired as changed?

The page finds the fewest added and removed lines. When a run of removed lines sits right before a run of added lines, they are paired in order and shown as changed, and the words or letters that differ are marked. Lines that share almost nothing are marked whole.

What does JSON mode do to my text?

It formats both sides with 2 spaces and sorts the keys at every level, then compares. Key order and spacing no longer show up as changes. Numbers stay as written. If a side is not valid JSON the page tells you where and compares that side as plain text.

Can I use the copied diff with patch or git apply?

Yes. Copy diff and Download .diff give the unified format with 3 lines of context, the same as diff -u. With no switches on, patch turns the left text into the right text. With a switch on, the diff follows what the page shows, so it may not apply exactly.

Why does a line show as changed when it looks the same?

Often it is a space at the end, a tab instead of spaces, or a different letter case. Turn on Ignore whitespace or Ignore case to hide these. Line breaks written as CRLF or LF are treated as the same.

More from FLXCode

  • JSON FormatterFormat, minify, sort and check JSON in your browser. Big numbers stay exact and errors show line and column.
  • Regex TesterTest JavaScript regular expressions with live matches, groups, flags and a replace preview. Runs in your browser.
  • Word CounterCount words, characters, sentences and paragraphs as you type. Reading and speaking time with speeds you can change.
  • Password GeneratorMake a random password or passphrase in your browser. See the entropy and its formula. Nothing is sent.

Share Diff Checker