Diff Viewer — Free Online Viewer
Compare two texts side by side with highlighted differences
All processing happens locally. No data is sent to any server.
A diff (difference) shows the changes between two versions of text. Our Diff Viewer compares two texts side by side with line-level and word-level highlighting. Paste your original text on the left and modified text on the right. Switch between Line Diff and Word Diff modes to see changes at different granularities. Added lines are highlighted in green, removed lines in red, and unchanged content remains neutral. The tool provides a clear visual representation of what changed between versions, making it easy to understand modifications at a glance. This is useful for code review, comparing configuration files, or tracking document changes. The word-level diff is especially helpful for identifying small changes within long lines, while line-level diff gives you a broader overview of structural changes. You can copy either text with a single click, making it easy to share or save your comparisons for documentation, code review, pull requests, or audit purposes. All processing happens in your browser — your data never leaves your device. This makes it safe to use with confidential code, proprietary content, or sensitive documents that need comparison and review. For related text processing, try our [Markdown Preview](/tools/markdown-preview) to render documentation, or use our [Regex Tester](/tools/regex-tester) to search for patterns in your text.
FAQ
What is a diff?
A diff shows the differences between two versions of text. It highlights what was added (green), removed (red), and unchanged, making it easy to see what changed.
Line diff vs word diff?
Line diff shows changes at the line level — entire lines are marked as added or removed. Word diff shows changes within lines, highlighting individual words that changed.
Can I use this for code?
Yes. The diff viewer works with any text, including source code. It's useful for code review and comparing different versions of files.