Text Diff
Compare two versions of plain text and see added, removed, and unchanged lines.
Compare lines of text. CRLF and CR line endings are treated as LF; spaces, tabs, case and the final newline remain significant. Each side supports up to 50,000 UTF-16 code units and 1,000 line tokens, including empty lines.
Enter two versions, then select Compare.
How to use Text Diff
- Paste the first version into Original text and the second into Modified text, or load the example.
- Select Compare to align the lines. Review the counts and the labeled original/modified result.
- Copy diff if needed. Editing either input clears the old result; Clear removes both inputs and the result.
Example
Input / settings:
Original: APP_ENV=staging LOG_LEVEL=debug CACHE_ENABLED=false Modified: APP_ENV=production LOG_LEVEL=info CACHE_ENABLED=false REQUEST_TIMEOUT=30
Output:
- APP_ENV=staging - LOG_LEVEL=debug + APP_ENV=production + LOG_LEVEL=info CACHE_ENABLED=false + REQUEST_TIMEOUT=30
When to use
- Review configuration changes before deployment.
- Compare redacted log excerpts from two runs.
- Check revisions to documentation, SQL, or source text without parsing or executing it.
Overview
Compare two versions of plain text and see added, removed, and unchanged lines.
Supported input
Two pasted texts, each up to 50,000 UTF-16 code units and 1,000 line tokens. Empty inputs are allowed. Empty lines and the final newline count toward the line limit.
Output details
Aligned original and modified lines with line numbers and additions/removals. Copy diff adds +, -, or space prefixes to normalized lines while preserving their spaces and tabs.
Limitations
- Line comparison only, not word/character changes, merging, syntax validation, or semantic comparison. Replacements and moves appear as removals and additions.
- CRLF and CR are normalized to LF for comparison; this is not byte-for-byte file comparison. Case, spaces, tabs, Unicode forms, empty lines, and a final newline remain significant.
- Repeated lines can have several valid alignments; equal-length choices remove an original line first. Empty-line annotations are display labels, not input.
- Inputs above the stated limits are rejected without truncation. Copied output is a readable line comparison, not a git/unified patch.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers.
References
Frequently asked questions
How is this different from JSON Diff?
Text Diff accepts arbitrary text and compares its lines without parsing or formatting. JSON Diff parses and formats valid JSON before comparing it. Use Text Diff when original spacing and non-JSON content matter.
Are whitespace and line endings ignored?
Spaces, tabs, case, empty lines, and a final newline are significant. Only CRLF and CR line-ending styles are normalized to LF. This does not compare file bytes.
Can one or both inputs be empty?
Yes. One empty input shows all lines as additions or removals. Two empty inputs have no differences.
Does it recognize moved or modified lines?
It aligns identical lines. Replacements and moves are shown as removals and additions; it does not infer semantic changes or highlight individual characters.
Can I apply the copied diff with git?
No. It is a readable comparison with line prefixes, not a patch with file names or hunk headers.
Is my text uploaded or saved?
The comparison runs locally in your browser. Our tool does not upload the inputs or save them in browser storage. Clipboard copies and ordinary hosting, analytics, or advertising activity are separate.