Count words, characters, sentences and reading time.
Text Diff
Compare two texts and see exactly what changed.
Runs in your browserProcessed locally. Your input never leaves your device.
The second version. The original goes in the main box on the left.
Details
About this tool
Compares two versions of a text and marks every addition and removal, line by line or word by word. Paste the original on one side and the changed version on the other; the differences are highlighted as you type.
Line mode is the right default for anything structured - code, configuration, CSV, logs - because a line is the unit that actually changed. Word mode is better for prose, where a rewritten sentence in line mode shows up as one line deleted and one line added, telling you nothing about what moved. Switching between the two is often the fastest way to understand a change: line mode to find where, word mode to see what.
The two ignore options exist for the noise that is not a change. Ignoring whitespace hides reindentation, trailing spaces and the line-ending difference between Windows and Unix - which otherwise makes every single line look modified when a file has simply been saved by a different editor. Ignoring case is for comparing content where capitalisation is not meaningful, such as generated identifiers or headers.
This is a textual comparison, not a semantic one. Two JSON documents differing only in key order are the same document but will show as heavily changed; formatting both and sorting the keys first turns that into a clean diff. The same applies to reformatted code: run it through a formatter on both sides and compare the result.
Everything happens in your browser. That matters for the obvious reason - the two things people most often diff are a contract and a configuration file - and it means there is no upload limit beyond what your own machine can hold.
Keep going
Related tools
- Runs in your browserText
-
Convert text between upper, lower, title, camel, snake and kebab case.
Runs in your browserText -
Format, indent and beautify JSON.
Runs in your browserDeveloper
Good to know
Questions people actually ask
- Is my text uploaded anywhere?
- No. Both versions are compared in your browser and neither leaves your device. The two documents people most often diff are a contract and a production configuration file, so this is the tool where it matters most.
- What do the markers mean?
- Added content is marked as an addition and removed content as a removal, relative to the first text. A modified line appears as a removal followed by an addition, because that is what a change is at the level a diff works: the old version gone and the new one in its place.
- Line by line or word by word - which should I use?
- Line mode for code, configuration and data, where the line is the unit that changed. Word mode for prose, where line mode reports a rewritten sentence as one deletion and one addition and tells you nothing useful. Trying both is often quicker than deciding.
- Why does the whole file show as changed?
- Usually line endings. A file saved on Windows ends its lines with CRLF and one saved on macOS or Linux with LF, so every line differs even though the text is identical. Turn on "ignore whitespace" and the real changes appear.
- Can it diff two JSON files properly?
- It compares them as text, so two documents identical apart from key order will look heavily changed. Format both with the JSON formatter and turn on key sorting first - then the diff shows only the differences that are actually differences.