Diff Checker – Compare Text Online

Paste two versions of a text to see exactly what changed. This diff checker compares them line by line, highlights the changed words or characters inside each edited line, and shows the result side by side or as a single unified view. You can ignore whitespace or letter case, swap the two sides and copy a standard unified diff.

0added
0removed
0unchanged
Ready.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

Rate this tool

Be the first to rate this tool

How to use the Diff Checker

  1. Paste the original version in the left box and the changed version in the right box.
  2. The comparison updates as you type: removed lines are shaded orange, added lines green, and changed words are highlighted inside each line.
  3. Switch between Side by side and Unified, highlight by Words or Characters, or ignore whitespace and case.
  4. Turn on “Only show changes” for long texts, then copy the unified diff to share it or attach it to a ticket.

How this diff checker compares text

A diff answers one question: what is the smallest set of line insertions and deletions that turns the original text into the changed one? This tool uses the Myers diff algorithm, the same approach behind Git’s default diff, to find that shortest edit script. Lines that only appear in the original are marked as removed, lines that only appear in the new version are marked as added, and everything else is unchanged. When a removed line and an added line sit in the same spot, they are shown as a pair and the tool runs a second, finer diff inside them, so you see exactly which words or characters were edited instead of two whole lines in color.

Side by side or unified view

The side-by-side view puts the original on the left and the changed text on the right with line numbers for each, which is the easiest way to read edits to prose, contracts and configuration files on a wide screen. The unified view stacks removed lines (marked −) directly above their replacements (marked +), which fits small screens and matches what you see in Git and code review tools. On phones the tool starts in unified view; you can switch at any time. “Copy unified diff” produces standard unified format with @@ hunk headers and three lines of context, ready to paste into an issue, an email or a patch review.

Ignore options and word versus character highlights

  • Ignore whitespace: treats lines as equal when they differ only in spaces, tabs or indentation. Useful after reformatting code or copying text from a PDF.
  • Ignore case: treats “Hello” and “hello” as the same.
  • Words: highlights whole changed words, best for documents and sentences.
  • Characters: highlights individual characters, best for IDs, numbers, URLs and small typos.

Privacy and limits

The comparison runs entirely in your browser; nothing you paste is uploaded or stored. To keep the page responsive, the tool compares up to 50,000 lines in total, and it stops with a clear message if the texts differ in more than 2,500 lines or the comparison takes longer than a couple of seconds. In that case, compare smaller sections. Very large results show the first 5,000 rows on screen, while the copied unified diff always contains every change. If you only need to compare two lists of items regardless of order, the compare two lists tool is a better fit, and the remove duplicate lines tool can clean data before you compare. For JSON, run both versions through the JSON formatter first so the formatting matches.

Examples

  • “planned for Monday at 9 AM” → “planned for Tuesday at 10 AM”: one changed line; with Words, “Monday” and “9” are highlighted on the left and “Tuesday” and “10” on the right.
  • Adding a new line in the middle: counted as 1 line added, 0 removed, and shown in green.
  • “ return x;” vs “return x;” with Ignore whitespace on: no differences.

Diff Checker FAQ

Is my text uploaded anywhere?

No. The diff is calculated in your browser with JavaScript, so your text never leaves your device. You can even use the tool offline once the page has loaded.

Why does a changed line count as one added and one removed?

A diff works at the line level, so an edited line is recorded as the old line removed and the new line added. That is how Git and other diff tools count changes too. The inline highlights then show what changed within the line.

What is a unified diff?

A plain-text format that lists changes in hunks starting with @@ -start,count +start,count @@, with removed lines prefixed by a minus sign, added lines by a plus sign and context lines by a space. It is the format used by Git, patch files and code review tools.

Can I compare code with different indentation?

Yes. Turn on “Ignore whitespace” and lines that differ only in spaces or tabs are treated as equal, so you can focus on real changes.

How large can the texts be?

Up to 50,000 lines combined. If the two versions are extremely different, the tool stops and asks you to compare smaller parts so your browser does not freeze.

Related tools

All Developer Tools
JSON Formatter & ValidatorBeautify, minify and validate JSON with clear error messages.Base64 Encode / DecodeEncode or decode Base64 for text and files, UTF-8 safe.Compare Two ListsFind differences, common items, and unique entries between two text lists.Cron Expression GeneratorBuild cron schedules with simple menus, or paste any cron expression to explain it in plain English and see the next 5 run times.HEX to RGB ConverterConvert HEX color codes to RGB, RGBA and HSL and back, with a live swatch, color picker, alpha control and copy-ready CSS.JSON to CSVConvert a JSON array to CSV with nested objects flattened into dot-named columns, comma, semicolon or tab delimiters and a live preview.JSON to ExcelConvert a JSON array to a real Excel .xlsx spreadsheet or CSV, with nested objects flattened into dot-named columns and a live preview.PX to REM ConverterConvert pixels (px) to rem and rem to px with custom root font size and CSS table.Regex TesterTest JavaScript regular expressions live: highlighted matches, capture and named groups, indices, flags and a replace preview.Unix Timestamp ConverterSee the current Unix epoch time live, convert timestamps in seconds, milliseconds or microseconds to dates, and dates back to timestamps.URL Decode & EncodeDecode or encode URLs and query strings (percent-encoding), with + as space option and a query parameter table.Online TimerA free countdown timer with presets, big digits and an alarm, plus a stopwatch with laps.Merge PDFCombine several PDF files into one document in any order.