Text diff
Paste two versions of a text or some code to see exactly what changed.
+3−2lines
| 1 | − | The quick brown fox | |
| 1 | + | The quick red fox | |
| 2 | 2 | jumps over the lazy dog. | |
| 3 | − | It was a sunny day. | |
| 3 | + | It was a sunny day, | |
| 4 | + | and the dog slept on. | |
| 4 | 5 | The end. |
How it works
Reading a diff
A diff lists what you would have to do to turn the original into the changed version. Lines marked + were added, lines marked − were removed, and an edited line shows up as one removed and one added line. The two number columns show where a line sits in the original and in the changed text.
Good to know
- Moving a block of lines shows as removed in one place and added in another; a diff doesn’t track moves.
- Invisible differences, such as trailing spaces or tabs instead of spaces, can make lines differ. Ignore whitespace hides changes in spacing. Windows and Unix line endings are treated the same.
- For JSON, format both versions with the JSON formatter first, so formatting doesn’t hide the real changes.
More tools
More on the bench
- JSON formatter and validatorPretty-print, minify and validate JSON, with the exact line of any error.
- Base64 encoder and decoderEncode text to Base64 and back, including URL-safe Base64 and emoji.
- URL encoder and decoderPercent-encode and decode URLs and query values, and break a URL into parts.
- Regex testerTest JavaScript regular expressions live, with groups and replace.
- CSV to JSON converterConvert CSV to JSON and JSON to CSV, with delimiter detection.
- UUID generatorGenerate random v4 or time-ordered v7 UUIDs, one or a hundred at a time.
- JWT decoderRead the header and claims of a JSON Web Token, with expiry dates in plain English.
- Hash generatorSHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text.
- Unix timestamp converterEpoch seconds or milliseconds to a readable date and back, in any time zone.
- Lorem Ipsum generatorPlaceholder paragraphs, sentences or words, plain or as HTML.
Frequently asked questions
How does the comparison work?
It uses the Myers diff algorithm, the same one behind git diff: it finds the smallest set of lines (or words) to remove and add to turn the original into the changed text. Unchanged parts are shown in between for context.
When should I compare words instead of lines?
Lines suit code, configuration and lists, where each line stands on its own. Words suit prose, where one edited word would otherwise mark a whole paragraph as changed.
What do the ignore options do?
Ignore case treats "Fox" and "fox" as the same. Ignore whitespace treats lines as equal when they only differ in spaces, tabs or indentation, which helps after re-indenting code.
Is my text uploaded?
No. Both texts are compared in your browser and never leave your device, so it is safe for code and private documents.