All Tools View Categories About Contact Privacy

Git Diff Viewer

Compare two file versions with Git-style changes, line numbers, inline edits and exportable diffs.

Runs entirely in your browser. Your compared text is not uploaded.
0 lines
0 lines
These options change matching, not your source text.
0
old lines
0
new lines
0
added
0
removed
0
change blocks
100%
similarity


    

About Git Diff Viewer

Git Diff Viewer compares two versions of a text file directly in your browser and presents the result in a Git-style review interface. Paste an older version on the left and a newer version on the right, then compare them line by line without installing Git or sending source code to a remote service.

The viewer builds a line-aware diff and groups consecutive additions, removals and unchanged content into readable change blocks. Changed lines receive line numbers for both versions, while modified lines can also show inline word-level differences. This makes small edits such as a renamed variable, changed configuration value or updated function call much easier to locate than comparing two large textareas manually.

Advanced comparison controls let you ignore leading and trailing whitespace, ignore all whitespace, ignore line-ending differences, or ignore letter case. These options affect comparison rather than altering the original text, so the source versions remain intact. Empty lines are preserved and line numbers continue to refer to the original versions.

Use side-by-side view when you want a familiar code-review layout, inline view when you want a compact list of changes, and unified diff when you need a patch-like representation that can be copied or saved. Search filters the visible changes, while summary statistics report total lines, additions, removals, changed blocks and similarity. You can swap the two versions, load realistic sample data, clear both editors, copy the unified diff, download a .diff file, or print the comparison.

Everything is processed locally in the browser. The tool does not require Git, an account, a package installation, or an external comparison API, making it useful for quick code reviews, configuration checks, troubleshooting, documentation updates and before-and-after comparisons.

Features

  • Git-style line diff — identifies added, removed and unchanged lines between two versions.
  • Side-by-side review — shows old and new content with independent line numbers and synchronized change blocks.
  • Inline review — presents changes in a compact single-column view.
  • Unified diff export — generates a patch-style result with headers and hunk ranges.
  • Inline word changes — highlights changed word or character spans inside modified lines.
  • Comparison controls — ignore case, leading/trailing whitespace, all whitespace, and line-ending differences.
  • Search and highlight — filter the visible diff by text or line content.
  • Review statistics — added, removed, unchanged, changed blocks, total lines and similarity.
  • Local file loading — open text files from the device without uploading them.
  • Copy and download — copy the unified diff or download it as a .diff file.
  • Swap and reset — reverse the comparison or return the editors and options to a clean state.

How to Use

  1. Add the old version. Paste the earlier file contents into the left editor, or use Open file.
  2. Add the new version. Paste the newer contents into the right editor.
  3. Choose comparison options. Enable only the whitespace or case rules you want the diff to ignore.
  4. Compare. Click Compare to calculate the line changes and review statistics.
  5. Review changes. Switch between side-by-side, inline and unified views, and use the search box to locate specific changes.
  6. Inspect small edits. Use inline word highlighting on changed lines to see the exact portions that changed.
  7. Export or print. Copy the unified diff, download the .diff file, copy the visible text, or print the comparison.
  8. Start another comparison. Use Swap, Clear or Load sample to quickly prepare the next comparison.

Examples

Example 1 — Code change. Compare a function before and after a bug fix to see which statements were added or removed and which modified lines contain word-level changes.

Example 2 — Configuration review. Compare two configuration files to identify changed ports, URLs, feature flags or environment values while ignoring indentation-only changes.

Example 3 — JSON or YAML. Paste two text-based configuration versions and use the whitespace options when formatting changes should not dominate the review.

Example 4 — Documentation. Compare two README versions and search for a heading or phrase to quickly locate the relevant change block.

Example 5 — Patch preparation. Compare the original and edited text, switch to Unified view, then copy or download the generated diff for review.

Benefits

  • Fast review: Find meaningful changes without manually scanning two documents.
  • Browser-based: No Git installation or external comparison service is required.
  • Private workflow: Text remains in the browser during normal use.
  • Flexible matching: Ignore formatting or case when those differences are not relevant.
  • Precise context: Line numbers and change blocks make edits easier to locate.
  • Detailed inspection: Word-level highlighting exposes small modifications.
  • Useful exports: Copy or download a unified diff for tickets, reviews and records.
  • Responsive interface: The review layout adapts to desktop and mobile screens.

Frequently Asked Questions

What can I compare?
You can compare two pasted text or code versions. You can also load local text files directly in the browser.
Does this tool upload my files?
No. Comparison and rendering happen in your browser. The tool does not send the compared content to a server.
What diff views are available?
Use side-by-side view for reviewing both versions together, inline view for a compact change list, or unified diff for a Git-style patch representation.
Can I ignore whitespace changes?
Yes. You can ignore leading and trailing whitespace, all whitespace, or line-ending differences when calculating the comparison.
Can I compare case-insensitively?
Yes. Enable Ignore case to treat letter-case differences as equal during comparison.
Does it show word-level changes?
For changed lines, the viewer can highlight changed word or character spans inside the line so small edits are easier to spot.
Can I search the diff?
Yes. The search box filters visible diff rows and highlights matching text in the rendered comparison.
Can I export the result?
Yes. You can copy the unified diff or download it as a .diff file. The comparison can also be copied as plain text.
What happens with identical files?
The tool reports that the files are identical and shows zero added, removed and changed lines.
Are there size limits?
The practical limit depends on your browser memory and the size and structure of the text. The tool is designed for normal source files and text-based configuration files, not binary files.