Upload your input and generate a TEXT-DIFF result to compare changes and review differences in one output.
Comparing two versions of a document, configuration file, code snippet, or any text to find exactly what changed is a fundamental task in software development, writing, and data management. XConvert's free Text Diff tool highlights every addition, deletion, and modification between two texts with precision — using the same diff algorithms that power Git and other version control systems — entirely in your browser with no data uploaded to any server.
Text diffing (or differencing) is the process of computing the minimum set of changes needed to transform one text into another. The result — called a diff, patch, or changeset — describes exactly which lines were added, removed, or modified. Diff algorithms are foundational to version control systems (Git, SVN, Mercurial), code review tools, document collaboration platforms, and any system that tracks changes over time.
The most widely used diff algorithm is the Myers diff algorithm, published by Eugene Myers in 1986. It computes the shortest edit script (the minimum number of insertions and deletions) to transform the original text into the modified text. The algorithm operates on lines by default, treating each line as an atomic unit. More sophisticated implementations add a second pass that computes character-level or word-level diffs within changed lines, highlighting exactly which parts of a line were modified rather than marking the entire line as changed.
Diff output can be presented in several formats. Side-by-side view shows both versions in parallel columns with corresponding lines aligned and differences highlighted. Inline (unified) view shows a single stream with deletions prefixed by - and additions prefixed by +, similar to git diff output. Context lines (unchanged lines surrounding changes) provide orientation within the document. The choice of view depends on personal preference and the nature of the changes — side-by-side works well for line-level changes, while inline is better for understanding the flow of modifications.
| Feature | XConvert Text Diff | diff (Unix CLI) | Meld | DiffChecker |
|---|---|---|---|---|
| Price | Free | Free (built-in) | Free | Free (basic) |
| Runs in Browser | ✅ | ❌ (CLI) | ❌ (Desktop) | ✅ |
| No Installation | ✅ | ✅ (pre-installed) | ❌ | ✅ |
| Side-by-Side View | ✅ | ❌ | ✅ | ✅ |
| Inline View | ✅ | ✅ | ❌ | ✅ |
| Character-Level Diff | ✅ | ❌ | ✅ | ✅ |
| Syntax Highlighting | ✅ | ❌ | ✅ | ✅ (paid) |
| Privacy (No Upload) | ✅ | ✅ (local) | ✅ (local) | ❌ |
| File Upload | ✅ | ✅ | ✅ | ✅ |
| Change Navigation | ✅ | ❌ | ✅ | ✅ |
Code review and debugging — Compare two versions of a source file to understand what changed between commits, branches, or releases. The character-level highlighting pinpoints exact modifications within lines, making it easy to spot subtle changes like variable renames or operator changes.
Configuration file auditing — Compare production and staging configuration files to identify differences before deployment. This catches unintended changes, missing settings, or environment-specific values that should differ. Works well with XConvert's YAML Validator and XML Validator for validating configs before comparing.
Document version comparison — Compare drafts of documents, contracts, policies, or specifications to track editorial changes. The diff highlights every word and sentence that was added, removed, or reworded.
Database record comparison — Export database records as CSV or JSON, then compare exports from different times or environments to identify data changes. Pair with XConvert's JSON Formatter to normalize formatting before comparing.
API response debugging — Compare API responses from different endpoints, environments, or time periods to identify unexpected differences. Format JSON or XML responses first using XConvert's formatters, then diff the formatted output for clean, meaningful comparisons.
Merge conflict resolution — When resolving merge conflicts, paste the conflicting versions into the diff tool to clearly see what each branch changed. This provides a cleaner view than the conflict markers (<<<<<<<, =======, >>>>>>>) in the file itself.
XConvert's Text Diff tool implements the Myers diff algorithm with linear space refinement, the same algorithm used by Git's default diff engine. The algorithm works by modeling the diff problem as finding the shortest path in an edit graph, where horizontal moves represent deletions, vertical moves represent insertions, and diagonal moves represent unchanged lines. The algorithm finds the minimum number of edits (insertions plus deletions) needed to transform the original text into the modified text, which produces the most intuitive and readable diff output.
After computing the line-level diff, the tool performs a second pass on changed line pairs to compute character-level (or word-level) differences within those lines. This is done by running the same Myers algorithm on the characters of each changed line pair. The result is precise highlighting that shows exactly which characters within a line were modified — for example, if a variable name changed from userName to userEmail, only the differing characters are highlighted rather than the entire line. This two-level approach (line-level first, then character-level within changed lines) provides both the structural overview and the fine-grained detail needed for effective comparison.
The rendering engine supports both side-by-side and inline views. In side-by-side mode, corresponding lines are aligned vertically, with blank placeholder lines inserted where one side has additions or deletions that the other does not. In inline mode, the output follows the unified diff format with context lines, deletion lines (prefixed with -), and addition lines (prefixed with +). Context lines (unchanged lines surrounding changes) are included to provide orientation — the default is 3 context lines, which can be adjusted. Change navigation buttons allow jumping between diff hunks without scrolling through unchanged sections. All processing happens client-side in your browser. Your text — which may contain source code, configuration secrets, proprietary content, or personal data — is never transmitted to any server.
Normalize formatting before comparing — If you are comparing JSON, XML, YAML, or SQL, format both versions with identical settings first using XConvert's JSON Formatter, SQL Formatter, or other formatting tools. This eliminates false positives from whitespace and formatting differences.
Use side-by-side view for structural changes — When comparing files with many additions and deletions (like refactored code), side-by-side view makes it easier to see the overall structural changes.
Use inline view for small edits — When comparing files with minor changes (typo fixes, small updates), inline view provides a more compact and readable output.
Trim trailing whitespace — Trailing spaces and tabs can cause lines to appear different when they are semantically identical. Enable the "ignore trailing whitespace" option if available, or trim both texts before comparing.
Compare smaller sections for complex changes — If comparing two very different files produces an overwhelming diff, try comparing individual sections or functions separately for more manageable results.
Use the change navigation buttons — For long documents with scattered changes, use the previous/next change buttons to jump directly between diff hunks rather than scrolling through pages of unchanged text.
The tool uses the Myers diff algorithm, the same algorithm used by Git's default diff engine. It computes the shortest edit script (minimum insertions and deletions) to transform the original text into the modified text, producing the most intuitive diff output.
Yes. After computing line-level differences, the tool performs a second pass to identify exactly which characters within changed lines were modified. This means you see precise highlighting of the specific words or characters that changed, not just entire lines marked as different.
No. All diff computation happens entirely in your browser using client-side JavaScript. Your text never leaves your machine. This is important when comparing source code, configuration files, or documents that contain sensitive information.
Yes. You can drag and drop files onto either editor panel, or use the file upload buttons. The tool accepts any plain text file regardless of extension. Binary files are not supported.
The practical limit depends on your browser and device memory. Most modern devices handle texts up to several megabytes without issues. For very large files (10MB+), the diff computation may take a few seconds. Extremely large files may benefit from command-line tools like diff or git diff.
Yes. The tool provides options to ignore leading whitespace, trailing whitespace, or all whitespace differences. This is useful when comparing code that has been reformatted or when whitespace changes are not meaningful.
Side-by-side view shows both texts in parallel columns with differences highlighted and corresponding lines aligned. Inline view shows a single unified output with deletions (red, prefixed with -) and additions (green, prefixed with +) interleaved, similar to git diff output.
You can compare any text format. For the best results with structured data like JSON or XML, format both versions first using XConvert's JSON Formatter or XML Validator to normalize whitespace and indentation before comparing.
Yes. The editor panels support syntax highlighting for common programming languages and data formats. This makes it easier to read the compared texts and understand the context of changes.
You can copy the diff output to your clipboard or download it as a text file. The downloaded diff follows the standard unified diff format that can be applied as a patch using standard tools. For comparing structured data, also check out XConvert's YAML Validator and Regex Tester for related text processing tasks.