Online diff checker for texts and local files up to 5 MB
Reviewing config edits, SQL migrations, or draft revisions often involves sensitive strings that should never be pasted into a file difference checker backed by a remote server. Running a client-side confidential text diff inside your browser tab keeps source code, environment variables, and legal drafts completely private with zero network uploads.
Loading Original and Changed files with zero uploads
Paste your baseline text into Original and the updated draft into Changed, or click Try an example to load a sample YAML configuration diff. Both panes also include an Open file button that reads local UTF-8 files up to 5 MB (5,000,000 bytes) directly via the MDN File and Blob text() API Reference.
Because diffLines normalizes both Windows \r\n and Unix \n line endings when splitting lines, moving files between operating systems does not flood the output with false changes. If you need to compare contracts, invoices, or multi-page reports saved in PDF format rather than plain text, compare two PDF documents word by word in a dedicated local workspace.
Reading live +added and -removed line counts
Above the comparison table, the Differences header updates live with exact +N added and -N removed line counts. When both inputs match under your active filters, the header reports No differences so you can confirm parity immediately.
Because every comparison runs purely in memory inside your browser tab, you can disconnect from the network once the page loads and continue auditing sensitive files offline.
Word-level highlighting, Ignore case, and Ignore spacing
Scanning two long lines to spot a single changed port number or typo wastes time when an entire line is shaded red or green. Pairing consecutive removed and added lines with inline word highlighting pinpoints the exact changed tokens inside modified rows.
How 30% line similarity triggers inline word diffs
The diff engine computes a longest-common-subsequence (LCS) alignment using a flat Uint32Array buffer, a typed memory structure documented in the MDN JavaScript TypedArray Reference. First, it trims identical prefix and suffix lines so unchanged headers and footers cost zero table memory.
When a run of removed lines is followed immediately by added lines, each pair is compared word by word. If at least 30% of the longer line’s characters remain identical, only the changed words receive stronger highlight badges; otherwise, the full lines display as replaced.
Normalizing letter case and whitespace runs before diffing
Checking Ignore case folds both inputs to lowercase during line matching, while Ignore spacing collapses consecutive spaces or tabs and trims line edges. Even with those filters enabled, the rendered table preserves your original casing and indentation so you can inspect the exact source text. If a draft has inconsistent capitalization you want to fix permanently rather than ignore, standardize capitalization across drafts using the case converter.
How does the diff engine handle files over 20,000 characters?
Comparing large logs or generated manifests on the main UI thread can stutter while you type. Whenever combined text exceeds 20,000 characters, this tool automatically moves the LCS calculation into a background Web Worker and paginates long outputs 1,000 lines at a time.
Automatic Web Worker offloading with 120 ms debounce
Below 20,000 combined characters, diffs update synchronously on every keystroke. Above 20,000 characters, the UI debounces edits by 120 ms, shows Comparing… in the header, and runs diffLines in a worker thread built on the MDN Web Workers API Reference.
If you are comparing two minified API responses where every key sits on one giant line, prettify minified JSON payloads with the JSON formatter first so each property gets its own line number.
Progressive 1,000-line pagination and LCS cell limits
To keep browser memory bounded on extreme inputs, the LCS table caps its matrix at 4,000,000 cells (roughly 16 MB). Long diff outputs render the first 1,000 rows immediately and display a Show 1,000 more lines button at the bottom so DOM layout never stalls.
When should you use Side by side vs Unified diff viewer?
Choose Side by side when comparing structured configs, prose drafts, or wide code lines where reading old and new columns horizontally makes edits obvious. Switch to the Unified diff viewer on narrow screens or when scanning sparse changes across a long file in a single vertical stream.
The Unified layout mirrors the dual line-number and +/- marker conventions defined in the POSIX diff Utility Specification. Both views highlight inline word changes identically and stay synced when you toggle filters. Use the table below to pick the right view and filter settings for your task.
| View or filter | Layout & columns | Best suited for | Pagination & limits |
|---|---|---|---|
| Side by side | Two columns with line numbers | Config files, prose, wide code | 1,000 rows per page |
| Unified | Single stream with before/after numbers | Narrow screens, sparse patches | 1,000 rows per page |
| Ignore case | Case-insensitive line key | SQL keywords, log levels | Preserves original display case |
| Ignore spacing | Collapses spaces and trims edges | Indentation refactors | Preserves original indentation |
Tip: Need to extract or verify patterns inside a changed log block before comparing? Test your expression in Regex tester with live match highlighting.