Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

Text Diff

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Everything runs locally in your browser. Your data never leaves your device.

Paste text into both panes to see the differences highlighted here.

Next steps

Send this tool's output straight into another tool.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Convert between scientific notation and full numbers as you type. Reads 1.23e5, 1.23 × 10^5 and plain numbers, shows the value written out, in normalized scientific notation and in engineering notation, and can round to any number of significant digits.

About the Text Diff Tool

This tool compares two pieces of text and shows exactly what changed between them. Paste the original version on one side and the changed version on the other, and every added, removed and modified line lights up, with the changed words marked inside each line.

Read the result side by side or as a single inline list, and check the summary to see how many lines were added, removed or modified and how much of the text changed overall. Long unchanged stretches fold away so the differences stay in view.

What you can do

  • Compare two texts line by line with the differences highlighted.
  • See the changed words marked inside each modified line.
  • Switch between a side by side view and an inline view.
  • Ignore case, whitespace or blank lines while comparing.
  • See how many lines were added, removed and modified.
  • Copy the result as a unified diff or download it as a patch file.

How to use the Text Diff

  1. 1Paste the original text into the left pane and the changed text into the right pane.
  2. 2Pick the split or inline layout, whichever reads better for your texts.
  3. 3Toggle the compare options to ignore case, whitespace or blank lines.
  4. 4Read the highlighted differences and the change summary above them.
  5. 5Copy the unified diff or download it as a .patch file to share the changes.

How the differences are matched

The comparison works line by line, using the same algorithm code review tools and version control systems use. When a block of lines is replaced by another block, the lines are paired up and compared word by word, so a small edit inside a long line shows as a highlight on the changed words rather than a fully red and fully green line.

Line numbers on each side always refer to the original texts, so you can find a change in your source even when the compare options hide some differences.

For two JSON documents the JSON Diff is usually the better fit. It compares the parsed structure instead of lines, so formatting and key order stop counting as changes.

The compare options

Ignore case treats lines that differ only in upper or lower case as equal. Ignore whitespace trims each line and collapses runs of spaces and tabs, so indentation and alignment changes stop counting as differences. Ignore blank lines leaves empty lines out of the comparison entirely. The panes keep your text exactly as you pasted it, the options only change what counts as a difference.

Unified diff export

The copy and download actions give you the result in unified diff format, the plain text form used by git diff and the patch command. It reflects the comparison you see, so differences hidden by the compare options are not included.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • jsdiff

    A JavaScript implementation of the classic Myers diff algorithm.

Everything this site builds on is listed on the credits page.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Escape text into HTML entities or decode entities back to plain text. Choose named or numeric entities, escape only the unsafe characters or everything outside ASCII, and read the result live.

Reveal the characters you can't see in a text: zero-width spaces, non-breaking spaces, bidi marks, control characters and CRLF versus LF line endings. Inspect every occurrence and clean them out with a click.