DEV Community

Jerry Zhang
Jerry Zhang

Posted on Originally published at compare-text.online

Side-by-Side Text Diffs in the Browser (When Git Is the Wrong Tool)

git diff is perfect when the text already lives in a repository. A lot of the text I actually have to review does not: an email draft, a Terms page exported from a CMS, a YAML file pasted in chat, two versions of a blog post in a Docs tab, a SQL script someone sent as an attachment. For those, I want a visual redline I can open in the browser, with word-level highlights and an export I can drop into a ticket.

That is a different job from a commit. This post is the workflow I use for it.

Decide what “same” means before you paste

A useful compare session starts with two rules:

  • What should count as a change? (punctuation, whitespace-only, letter case)
  • What will you do with the result? (a stakeholder review, a patch for an engineer, a note in a ticket)

If you are reviewing legal or marketing copy, case and punctuation matter. If you are comparing two log dumps, you may want to ignore whitespace so real deltas show up. Set those expectations first, or you will argue about noise.

Paste or drop two UTF-8 sources, then pick a view

Compare Text is a free, in-browser diff tool. You paste the original on the left and the modified version on the right, or you drop two files. The diff updates immediately with additions, deletions, and in-line edits.

Two layouts cover most reviews:

  • Split (side-by-side) for reading prose or a config file like a human
  • Unified when you want a single stream of context, additions, and deletions, closer to a git patch

Word-level highlighting inside changed lines is the feature that makes copy reviews sane. A whole-line red/green dump hides whether someone changed “affect” to “effect” or rewrote the sentence. There is also a similarity score, change counts, and J/K navigation between edits — small things that matter once the file is longer than a screen.

You can ignore whitespace and case when the job needs it. Snapshots can be saved to browser history. Exports include an HTML report for stakeholders, a unified patch for engineers, and Markdown for tickets and docs.

Comparison itself runs locally. Official FAQ language is clear: content is only sent to a server if you later enable an optional network feature such as AI analysis (and a key is configured). For confidential drafts, I leave that off.

What this is better at than git — and what it is not

Git needs a repo, commits, and usually a branch. Compare Text works on any two pastes or files. That includes TypeScript, Python, YAML, JSON, SQL, Markdown, and logs. For structured JSON, the site has a dedicated JSON Diff page that can pretty-print and sort keys, which is the right tool when a key reordering would otherwise look like a huge change. There are also sister pages for PDF, image, and CSV diffs if the thing in front of you is not plain text.

It will not replace git blame, pull-request review, or a merge conflict editor. If the text already belongs in version control, put it there. Use the browser redline for the work that never got a repo.

A review ritual that keeps you from skimming

  1. Start in split view and jump between changes with the keyboard, not only with the scroll wheel.
  2. For each change, mark it mentally as intended, unintended, or needs a question.
  3. If the file is huge, compare a focused excerpt, or temporarily turn off word-level highlighting if it gets sluggish. Word-level mode already concentrates on changed lines so unchanged regions stay fast, but a multi-megabyte dump is still the wrong unit of review.
  4. Export the format your audience will actually open. Do not send a patch file to a product manager, and do not send a glossy HTML report to someone who needs to apply the diff.

The interface is available in multiple languages, which helps when the source text itself is not in English and you still want the chrome of the tool to stay out of the way.

If you want a free, no-drama place to run this, open https://compare-text.online/, paste both versions, and export the review in the format the next person can use.

Top comments (0)