jarvisbox

Text Diff

Compare two texts and highlight additions and deletions line by line.

100% client-side
Granularity:
Diff output Added Removed

Click Compare to see the diff…

Why use a text diff tool?

Comparing two versions of a document, configuration file, or code snippet by eye is error-prone, especially for longer texts. A diff tool instantly highlights exactly what changed, making it easy to review edits, catch unintended changes, or understand how a document evolved. This browser-based tool keeps your text completely private — useful when the content is sensitive and you cannot paste it into a cloud service.

How to use

Paste the original text into the Before box and the modified version into the After box. Choose a granularity — Line for whole-line comparison, Word to highlight individual word changes, or Character for character-by-character diff including CJK and emoji. Click Compare to see the diff. Removed content appears with a red background; added content with a green background. Enable "Ignore trailing whitespace" to treat lines that differ only in trailing spaces as identical.

Frequently Asked Questions

How does the diff algorithm work?
The tool uses the Myers diff algorithm (via the diff.js library) to compute the shortest edit script between the two texts. It highlights added content in green and removed content in red.
How does diff granularity work?
Line mode compares entire lines — best for code or structured text. Word mode highlights individual words that changed. Character mode shows every character (or grapheme) that was inserted or removed, making it ideal for comparing Chinese, Japanese, Korean text, or emoji.
Does Character mode support Chinese, Japanese, and emoji?
Yes. Character mode uses Intl.Segmenter to split text into grapheme clusters, so CJK ideographs, emoji, and all multibyte characters are treated as single units and compared correctly — no surrogate-pair splitting.
Can I compare large texts?
Yes. The diff runs in your browser using JavaScript and handles texts up to tens of thousands of lines. Very large diffs may take a moment to render, but there are no upload size limits.
Are the texts saved anywhere?
No. Both texts stay entirely in your browser memory. Nothing is sent to a server. Closing or refreshing the page clears everything.

Last updated:

Report a problem with this tool