Diff Checker
Compare two texts line by line
See what changed between two versions of text or code, with word-level highlights, side-by-side or unified.
- Diff
- Compare
- Text
- Code
How to use Diff Checker
- Paste the old version into Original and the new one into Changed, or drop a text file on either box. Try an example loads a sample pair.
- Read the result: removed lines are marked on the original side, added lines on the changed side, and the exact words that changed inside a modified line are highlighted.
- Tick Ignore leading/trailing whitespace, Ignore all whitespace or Ignore case to hide differences you don’t care about.
- Switch the View between Side by side and Unified, and use Collapse unchanged lines with Context lines to hide long unchanged stretches. Swap sides exchanges the two texts.
- Use Copy unified diff to get the changes in the standard
---/+++/@@patch format.
How it works
Both texts are split into lines, with CRLF and CR line endings normalised to LF first. The lines are compared with the Myers difference algorithm (linear-space variant), which finds the smallest set of removed and added lines that turns the original into the changed text. With the ignore options on, lines are compared after trimming, removing all whitespace or lower-casing, but they are shown as you typed them.
Inside each block of changes, removed and added lines are paired in order, and each pair is diffed again word by word (runs of letters, digits and underscores, runs of whitespace, and single punctuation characters) to highlight exactly what changed.
The comparison runs in a Web Worker in your browser, a quarter of a second after you stop typing, so large inputs don’t freeze the page. The unified diff uses 3 lines of context and marks a missing final newline with \ No newline at end of file.
Limits
- Each side can be up to 2,000,000 characters (about 2 MB) and 50,000 lines. Dropped files can be up to 10 MB, but the 2 MB limit still applies to the text.
- The comparison is line-based: a change anywhere in a line marks the whole line as changed, with the changed words highlighted. Moved blocks show as a removal and an addition.
- Word highlights are skipped when a removed and an added line are together longer than 20,000 characters; the whole line is highlighted instead.
- If two texts are very different, the algorithm stops after a fixed amount of work and shows the remaining part as whole blocks replaced, with a note, rather than a minimal line-by-line match.
- A missing newline at the end of one text counts as a change to its last line, unless a whitespace option is on. Different line endings (CRLF vs LF) are normalised and only mentioned in a note.
- The result shows 2,000 rows at a time; Show more lines reveals the next ones. Phones always get the unified view.
Privacy
Both texts are compared in your browser and never uploaded or stored. The Share button (Copy share link) puts both texts and the options in the link’s # fragment, which browsers don’t send to servers; links are limited in size, so long texts show Too large to share. Text sent here from another tool with Send to… goes into Original through this tab’s session storage and is removed as soon as it is read.
Frequently asked questions
Why does a line show as changed when it looks the same?
It usually differs in invisible characters, such as trailing spaces, tabs instead of spaces, or a missing newline at the end of the text. Turn on Ignore leading/trailing whitespace or Ignore all whitespace to check.
Do Windows (CRLF) and Unix (LF) line endings count as differences?
No. Line endings are normalised to LF before comparing. If the two texts use different endings, a note above the result tells you.
Can I use the output as a patch?
Copy unified diff gives standard unified diff hunks with 3 lines of context, headed --- original and +++ changed. Rename the headers to real file paths if a patch tool needs them.
Why is a big section shown as replaced rather than matched line by line?
For very different inputs the diff stops after a fixed amount of work so the page stays responsive, and the rest is shown as one removed and one added block. The note These texts are very different tells you when this happened.
Does it understand code or JSON structure?
No. It compares plain text line by line and word by word, so reordered keys or reformatted code show as changes. For JSON documents, the JSON Diff tool compares the structure instead.
More tools
- Clean Image: Inspect and remove hidden image metadata
- JWT Decoder: Decode and verify JSON Web Tokens
- JS Runner: Run JavaScript and TypeScript in your browser
- JSON Formatter: Format, validate and minify JSON
- Encode / Decode: Base64, URL, HTML entity and hex
- Hash Generator: MD5, SHA and HMAC of any text
- UUID Generator: Generate UUID v4 and v7 in bulk
- Timestamp Converter: Unix time ↔ human dates
- Regex Tester: Test regular expressions live
- URL Parser: Break a URL into its parts
- HTTP Status Codes: Look up any HTTP status code
- MIME Type Lookup: File extension ↔ MIME type
- Password Generator: Strong random passwords and passphrases
- Random String Generator: Random tokens, IDs and keys
- Slug Generator: Turn titles into URL slugs
- Case Converter: camelCase, snake_case, Title Case and more
- Word Counter: Count words, characters and reading time
- JSON to TypeScript: Generate TypeScript types from JSON
- JSON Diff: Compare two JSON documents structurally
- JSON to SQL: Turn JSON arrays into SQL inserts
- YAML ↔ JSON: Convert between YAML and JSON
- XML ↔ JSON: Convert between XML and JSON
- CSV ↔ JSON: Convert between CSV and JSON
- CSV Viewer: View, sort and filter CSV files
- SQL Formatter: Format and beautify SQL queries
- cURL ↔ Fetch: Convert cURL commands to fetch and back
- Markdown Editor: Write Markdown with a live preview
- Text Cleaner: Remove duplicate lines, empty lines and extra spaces
- Find & Replace: Find and replace in any text
- Cron Expression Builder: Build and explain cron schedules
- User-Agent Parser: Identify browser, OS and device from a user agent
- HTTP Headers Inspector: Paste response headers and get them explained
- JWT Generator: Create and sign test JSON Web Tokens
- Certificate Inspector: Decode PEM certificates and keys
- Meta Tag Inspector: Check a page's SEO and social tags
- UTM Builder: Build campaign URLs with UTM parameters
- URL Cleaner: Strip tracking parameters from links
- Robots.txt Generator: Create and test a robots.txt file
- Sitemap Generator: Create an XML sitemap from a list of URLs
- Image Compressor: Shrink JPEG, WebP and AVIF images in your browser
- Image Resizer: Resize images by pixels, percentage or to fit a box
- Image Converter: Convert between PNG, JPEG, WebP and AVIF
- Image to Base64: Encode images as Base64 data URIs and decode them back
- SVG Optimizer: Minify and sanitize SVG files
- Favicon Generator: Make favicon.ico, Apple and Android icons from an image or emoji
- Color Converter: HEX, RGB, HSL, OKLCH and contrast checks
- Number Base Converter: Binary, octal, decimal, hex and float bits
- IP / CIDR Calculator: Subnets, masks and IP ranges for IPv4 and IPv6
- JSONPath Query: Query JSON with JSONPath expressions
- JSON Schema Validator: Validate JSON against a schema, or generate one
- Semver Checker: Check versions against semver ranges
- chmod Calculator: Unix permissions: rwx ↔ octal
- .env Diff: Compare and validate .env files
- TOTP Generator: Generate and verify 2FA codes
- String Escaper: Escape and unescape strings for any language
- Unicode Inspector: See every character, code point and hidden symbol
- Mock Data Generator: Generate realistic fake data
- QR Code Generator: Create QR codes for links, Wi-Fi and contacts
- Lorem Ipsum Generator: Placeholder text in paragraphs, sentences or words
- Date Calculator: Date differences, business days and durations
- Unit Converter: Convert bytes, lengths, weights, temperatures and more
- Query CSV with SQL: Run SQL queries on CSV files
- PDF Merge & Split: Merge, split, reorder and rotate PDFs
- PDF Metadata Cleaner: See and remove hidden PDF metadata
- Office Metadata Cleaner: Remove author and revision data from Word, Excel and PowerPoint
- Images to PDF: Combine images into one PDF
- Image Editor: Crop, rotate, resize and adjust images
- Encrypt / Decrypt Text: Encrypt text with a passphrase (AES-GCM)
- SSH Key Generator: Generate Ed25519 and RSA SSH keys locally
- Email Header Analyzer: Trace an email's path and check SPF, DKIM and DMARC
- JSON to Code: Generate Go, Python, Rust, Java, C# and Kotlin models from JSON
- docker run ↔ Compose: Convert docker run commands to docker-compose and back
- Color Palette Extractor: Pull the dominant colours out of any image
- Password Strength Checker: How long would your password take to crack?
- SPF / DKIM / DMARC Checker: Validate and explain email DNS records
- Kubernetes YAML Checker: Validate and explain Kubernetes manifests
- .gitignore Generator: Build a .gitignore from presets
- CSP Builder: Build and check a Content-Security-Policy
- JSON-LD Generator: Create schema.org structured data
- Open Graph Image Generator: Make 1200×630 social preview images
- CSS Generator: Gradients, shadows, clamp() and more
- Time Zone Meeting Planner: Find meeting times across time zones