Diff Viewer
Visually compare differences between two text blocks and instantly identify additions, removals, and changes.
Line breaks and whitespace differences are also highlighted, helping you catch even subtle modifications.
This tool is useful for reviewing documents, proofreading content, and checking revisions in source code or specifications.
All comparisons are performed directly in your browser, and no text is sent to any server.
Changed lines also highlight the exact words that changed, and the diff updates as you type. You can open or drop files, compare JSON ignoring key order, jump between changes, and download the patch. You can ignore whitespace or letter case, view the result side by side, fold unchanged lines, and copy the result as a unified patch (the format of git diff -u).
You can also drop a file onto the text box. Files are read in your browser only.
Red lines (left) and green lines (right) mark the differences while you type. Turned off while whitespace, blank-line, sort or JSON options are on.
The diff updates as you type
JSON differences by path
Compares the two JSON texts above by structure: object keys in any order, arrays by index. Lists each added, removed and changed value with its path.
No differences: the two JSON values are equal.
Apply a patch
Paste a unified diff (the output of git diff or diff -u) and apply it to the text in the left box. The result is the patched text. If the patch does not match, nothing is changed.
The patch does not match the text in the left box (or is not a unified diff).
Merge
For each change, choose the left (old) text, the right (new) text, or both. The merged text appears below; you can copy it or put it back into either box.
No differences, so there is nothing to merge.
3-way merge
Merge two edited versions of the same text. Paste the common original (base) and the two versions. Changes in different places are combined; changes to the same lines become conflicts that you resolve one by one.
GuideHow to use & features
- Paste the original text on the left and the modified text on the right, then click “Show diff.”
- Additions appear in green and removals in red, making changes easy to spot.
- After viewing, use the copy buttons under each pane to share either version.
- Very large inputs may take a few seconds to render—please keep the tab open until it finishes.
SamplesSample input & output
Compare two short files
Left
console.log("hello");
Right
console.log("hello world");- console.log("hello");
+ console.log("hello world");FAQFAQ
What does it compare by?
By line. It compares two texts and shows added lines in green and removed lines in red, with the counts of lines added and removed. It does not show which characters differ within a line.Is the output the same as Git's `diff` (unified format)?
No. It does not produce headers such as `@@ -1,3 +1,4 @@` or patch-style `+` and `-` output. It is a tool for viewing differences on screen.Do whitespace and trailing-newline differences count?
Yes. Whitespace within lines, indentation and whether there is a trailing newline are all treated as differences. There is no option to ignore whitespace.What kind of text can I compare?
Any text, such as code, config files, SQL, Markdown or logs. Paste the contents; loading a file is not supported.What if lines are only reordered?
It is a line-based diff, so they show as removals and additions. Moves are not detected.Is my text sent anywhere?
No. Comparison happens entirely in your browser.
Use casesCommon use cases
Checking config file changes
Paste before and after versions of `config.yml` or `.env.example` and see what was added or removed as a list.Checking your changes before a code review
Quickly compare changes made somewhere without Git, or the difference between copied code.Finding revisions in SQL and documents
Pick out only the changed lines between two versions of a document or SQL.Comparing generated output
Paste two results from a tool or an AI and follow what changed by eye.
NotesNotes & limitations
Highlighting inside a line works per word
Changed words inside a modified line are highlighted. Even a one-character change highlights the whole word. The colouring inside the input boxes works per line.Patches carry only simple file-name and date information
“Copy / download as patch” gives a unified diff. File names are placeholders (a / b), and Git commit data, permissions, binaries and renames are not included. Use `git diff` when you need a whole repository diff.Whitespace differences show up by default
Indentation changes and a missing trailing newline appear as differences. Turn on “Ignore whitespace” or “Ignore blank lines” to hide meaningless ones (CRLF versus LF alone is not a difference).Very large text gets slow
Text of tens of thousands of lines can take time to compare and make the browser sluggish.
AboutAbout this tool
Text Diff and Comparison Tool
This text diff tool compares two pieces of text and highlights added, removed, and changed lines. It is useful for code snippets, configuration files, documentation drafts, logs, generated output, and any situation where small changes are easy to miss by eye.
When to use it
- Review code before committing: Compare an old snippet with a new one and catch accidental edits.
- Check configuration changes: Compare JSON, YAML,
.env, server configs, or deployment settings. - Edit documentation: See exactly which sentences or lines changed between two drafts.
Review tip
Whitespace, indentation, and line endings can appear as differences. When reviewing a diff, separate meaningful content changes from formatting-only changes so you can focus on the behavior or wording that actually changed.
Articles for this tool
How to Read Text Diffs: Understanding Line-Level and Word-Level Comparison
Learn how to read diffs: the meaning of + and -, line vs. word-level comparison, handling whitespace and line endings, and practical uses in code review.
Unified Diff Format Reference: Reading @@ Hunks in git diff Output
How to read git's unified diff: what @@ -12,7 +12,9 @@ means, why a one-character edit shows as a whole-line replacement, and whitespace and line-ending traps.
