elefcode

Diff Viewer

Compare code and config line by line with changed words highlighted, diff JSON or YAML by structure, or read a .patch file.

Original
Modified
+6−4
1{1{
2 "name": "elefcode",2 "name": "elefcode",
3 "version": "1.0.0",3 "version": "1.1.0",
4 "description": "Developer tools",4 "description": "Free browser-based developer tools",
5 "author": "Jane Doe",5 "author": "Jane A. Doe",
6 "license": "MIT",6 "license": "MIT",
7 "homepage": "https://elefcode.com",
7 "dependencies": {8 "dependencies": {
8 "next": "16.2.6",9 "next": "16.2.6",
9 "react": "19.0.0"10 "react": "19.0.0",
11 "mermaid": "11.15.0"
10 }12 }
11}13}

Comparing prose? Text Diff compares by word and sentence and makes a track-changes redline.

Advertisement

Guide

About the Diff Viewer

A diff shows exactly what changed between two versions of a piece of text — which lines were added, which were removed, and which stayed the same. It's the same idea behind code review and version control, applied to any two blocks of text you paste in. This viewer highlights additions and deletions in color so differences jump out at a glance.

It's useful for comparing config files, spotting what changed in an API response, reviewing edits to a document, or checking two JSON payloads against each other. Everything runs in your browser — even sensitive files never leave your device.

Line diff vs. word diff

This tool compares text line by line, which is ideal for code, config, and structured data where each line is a meaningful unit. If you're comparing prose — essays, paragraphs, documentation — a word-level diff often reads better because it highlights the specific words that changed within a sentence. For that, try the dedicated Text Diff tool.

Comparing JSON cleanly

Two JSON objects can be logically identical but formatted differently, producing noisy diffs. Tick Normalise JSON to pretty-print both sides with sorted keys before comparing, or use the JSON / YAML structure tab, which compares the data itself: key order, spacing and even JSON-versus-YAML syntax make no difference, and each change is listed by its path — ready to copy as an RFC 6902 JSON Patch.

How to use it

  1. 1Paste or drop the original on the left and the changed version on the right.
  2. 2Choose side by side or unified, and which differences to ignore.
  3. 3Read the highlighted changes, expanding collapsed lines where you need context.
  4. 4Copy or download the result as a .patch — or use the structure tab for JSON and YAML.

Frequently asked questions

What do the colors mean?

Typically, removed lines are shown in red and added lines in green, while unchanged lines stay neutral. This makes it easy to see what was inserted or deleted between the two versions.

Can I compare two JSON objects?

Yes — two ways. The Compare tab with “Normalise JSON” shows a line diff with keys sorted; the JSON / YAML structure tab lists every added, removed and changed value by path and gives you a JSON Patch.

Can I view a git diff or a .patch file?

Yes. Paste it into “View a patch” — git diff output, a .patch file or a GitHub pull request’s .diff — and each file is shown with its hunks, line numbers and +/− counts.

What is the difference between this and the Text Diff tool?

This Diff Viewer is built for code and data: line by line, with changed words highlighted inside each line, patches and structural JSON diffs. The Text Diff tool is built for prose: word and sentence comparison and a track-changes redline.

Is there a size limit?

You can compare large blocks of text, but extremely large inputs may slow down the browser since all processing is local.

Is my text uploaded anywhere?

No. The comparison runs entirely in your browser, so nothing you paste is sent to a server.

Learn more

Related tools