Text Diff Tool
Paste two blocks of text to compare them line by line. Highlights additions, deletions, and unchanged lines instantly.
What is a Text Diff Tool?
A text diff tool compares two pieces of text and highlights the differences — additions, deletions, and unchanged lines — using colour-coded output similar to the git diffor Unix diff commands. It is an essential tool for reviewing changes in configuration files, code snippets, API responses, or any text where you need to quickly understand what changed between two versions without reading both in full.
Common Use Cases
- Compare two versions of a config file to find what changed after a deployment
- Spot differences between two API responses for the same endpoint
- Review a colleague's code changes before a formal code review
- Compare translated or edited documents to see what was added or removed
- Verify that a find-and-replace operation produced the expected changes
How It Works
The diff algorithm (an implementation of the Myers diff algorithm or similar LCS-based approach) computes the longest common subsequence of lines between the two inputs and classifies each line as unchanged, added (green), or removed (red). Line-level diffing is the default; word-level or character-level diffing can highlight more granular changes within a line. All comparison happens in your browser — text is never sent to a server.
Frequently Asked Questions
What is the difference between unified and side-by-side diff?
Unified diff shows both versions interleaved in a single column with + and - markers — compact and good for terminals. Side-by-side diff shows the two versions in parallel columns — easier to read for longer files or prose comparisons.
Does whitespace matter in the comparison?
By default, trailing whitespace and line-ending differences (CRLF vs LF) are included in the diff. Most tools offer an "ignore whitespace" option that skips purely cosmetic whitespace changes so you can focus on meaningful content differences.
How large a file can I diff in the browser?
Browser-based diff tools handle files up to a few hundred kilobytes comfortably. For very large files (megabytes), the diff algorithm can become slow due to the quadratic nature of LCS computation. Use command-line tools like diff or git diff for large files.
Related Tools
JSON Formatter
Format, validate, and minify JSON data instantly.
Base64 Encoder
Encode and decode strings using Base64 encoding.
JWT Decoder
Decode and inspect JSON Web Tokens securely in your browser.
JWT Generator
Build and sign JSON Web Tokens with a custom payload and secret.
Regex Tester
Test and debug regular expressions with live match highlighting.
JSON ↔ YAML
Convert between JSON and YAML instantly with real-time validation.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes instantly.
URL Encoder
Encode and decode URLs with percent-encoding instantly.
Unix Timestamp
Convert Unix timestamps to human-readable dates and back instantly.
UUID Generator
Generate UUID v4 values instantly, with bulk generation and validation.
Case Converter
Convert text to camelCase, snake_case, UPPERCASE, kebab-case, and more.
Cron Parser
Parse cron expressions into plain English and see the next scheduled run times.
SQL Formatter
Format and minify SQL queries with dialect support for MySQL, PostgreSQL, SQLite, and more.
CSV ↔ JSON
Convert CSV to JSON or JSON to CSV with support for custom delimiters and quoted fields.
Number Base Converter
Convert between decimal, hexadecimal, octal, and binary number bases.
Color Converter
Convert colours between HEX, RGB, HSL, HSV, and CMYK formats.
How it works: This tool uses a Longest Common Subsequence (LCS) algorithm to find the minimal set of changes between two texts — the same technique used by Git and most code review tools to produce line diffs.
All comparison happens locally in your browser. Neither panel's content is sent anywhere.