Text Diff — Compare Two Text Files Side by Side
Compare two text files and see differences highlighted line by line. Free online diff tool for code, docs, and config files.
Need to spot what changed between two versions of a file? The MyPDF Text Diff tool compares two text files side by side and highlights every addition, deletion, and modification — perfect for reviewing code changes, config updates, or document revisions.
How to Compare Two Text Files
- Upload or paste — Drop two files into the left and right panels, or paste text directly.
- Compare — The tool analyses both inputs and highlights the differences with colour coding.
- Review — Scroll through the unified or side-by-side diff view to inspect every change.
Diff View Modes
| Mode | Best For |
|---|---|
| Side by side | Comparing two complete files visually |
| Unified diff | Compact view showing only changed lines with context |
| Inline highlights | Seeing character-level changes within modified lines |
| Summary | Quick overview of how many lines were added, removed, or changed |
Practical Tips
- Use for config audits. Compare a production config file against staging to catch unintended differences before deployment.
- Compare extracted PDF text. Use the Extract Text tool to pull plain text from two PDF versions, then diff them here.
- Ignore whitespace changes. Toggle the whitespace option to focus on meaningful content changes rather than formatting differences.
What file types are supported?
Any plain text format — .txt, .md, .json, .xml, .yaml, .csv, .html, .css, .js, source code in any language. Binary files are not supported; convert them to text first.
Can I compare more than two files?
The tool compares exactly two inputs at a time. For multi-file comparisons, run separate diffs for each pair.
Is there a character or line limit?
The tool handles files with tens of thousands of lines. For extremely large files (100K+ lines), performance may vary depending on your browser.
Related Tools
- Extract Text — Extract plain text from PDFs and documents for diffing.
- Word Count — Count words and characters in text files.
- Compare PDFs — Compare two PDF documents directly.
- JSON Beautify — Format JSON before comparing.