Mr. Tools

How to

How to use the Text Diff Checker

Paste the before and after versions of a text and the differences are colored right away. Where a line exists on only one side, a striped gap is added to the other side so the lines stay level. What you enter is not sent anywhere and stays only on this device.

Text Diff Checker thumbnailText Diff Checker thumbnail
Steps
4 steps
Guide
With screenshots
Content
Notes and FAQ

Use Cases

When to use it

  • See what changed in a new version of a contract or terms
  • Check which parts were changed in a text someone edited for you
  • Check the changes in a configuration file
  • See only the code changes, leaving out differences in indentation

Capabilities

What this tool can do

  • Color the differences between two texts (red for removed, green for added)
  • Compare by line, word or character
  • Show the characters that changed inside similar lines
  • Add a gap across from lines that exist on only one side, so the lines stay level
  • Jump to the previous or next difference
  • Ignore differences in spaces at the start and end of lines
  • Color the text to match the language of your code

Steps

Steps

The order of operations and checkpoints are listed so you can proceed while looking at the screen.

STEP 1

Paste the two texts

Paste the original text into "Before" on the left and the new text into "After" on the right. While a box is empty, you can also press "Paste" in the bar at the bottom. There is no compare button: the differences are colored as soon as you enter text.

Screen with the Before and After boxes outlined in red

Checkpoints

  • Is the left side the before version and the right side the after version?

Where to look on screen

01
Paste and sample

"Paste" puts the text you have copied into that box. To try the tool, press "Insert sample" and a sample goes into both Before and After.

Screen with "Paste" and "Insert sample" in the bottom bar outlined in red

STEP 2

Choose how to compare

Start with "Line" to see the whole picture. If you want the number of changed words rather than lines, switch to "Word" or "Character". To ignore differences in indentation, turn on "Ignore whitespace".

Screen with Compare by and Ignore whitespace outlined in red

Checkpoints

  • Is the comparison unit as fine as you need?

Where to look on screen

01
Compare by

Choose Line, Word or Character. How the coloring and the numbers differ is explained below in "What changes when you switch the comparison unit?".

Screen with Compare by outlined in red
02
Ignore whitespace

When it is on, differences in spaces at the start and end of a line are not counted.

Screen with the Ignore whitespace switch outlined in red
03
Scroll sync

When it is on, scrolling one side moves the other side to the same place. It is on from the start.

Screen with the Scroll sync switch outlined in red
04
Language

Choose the language of your code and the text is colored so it is easier to read. Choose from Plain text, JavaScript, TypeScript, JSON, HTML, CSS, Markdown, YAML, XML and SQL.

Screen with Language outlined in red

STEP 3

Check the differences

Lines removed from Before turn red, and lines added in After turn green. When two lines are similar, the characters that changed inside them are shown in a darker shade. Where a line exists on only one side, a striped gap appears on the other side.

Screen with the colored differences and the removed and added counts outlined in red

Checkpoints

  • Are there any changes you did not intend?
  • Are the numbers at the bottom right what you expected?

Where to look on screen

01
Colored lines

In the example, 5678 in the phone number became 9999, 18 in the hours became 19, and one more space was added after Hours:.

Screen with the colored lines outlined in red
02
Previous difference and Next difference

Each press moves to the next difference, and which one you are on appears between the buttons, such as "1 of 2". Before you move, the number of differences appears, such as "2 places". After the last one, it goes back to the first.

Screen with Previous difference, the position, and Next difference outlined in red
03
Removed and added counts

With "Line", you see the number of lines, such as "2 lines removed / 3 added". With "Word" and "Character", you see the number of changed spots, such as "2 removed / 3 added".

Screen with the removed and added counts outlined in red

STEP 4

Edit and copy

You can rewrite either box right there, and the colors update as soon as you edit. Copy the finished text with "Copy" on that box.

Screen with "Copy" on the Before and After boxes outlined in red

Checkpoints

  • Did you press the button on the side you want to copy?

Where to look on screen

01
Clear and Copy

"Clear" erases the text in that box, and "Copy" copies it. Right after clearing, you can bring the text back with the "Undo" that appears.

Screen with "Clear" and "Copy" on the After box outlined in red

What changes when you switch the comparison unit?

We compared a text where the phone number and the hours were changed, one space was added, and one line was added.

Counts and coloring for each comparison unit
Compare byNumbers at the bottom rightHow it is colored
Line2 lines removed / 3 addedChanged lines are colored. Inside the lines, 5678 → 9999, 8 → 9 and the added space are darker
Word2 removed / 3 added5678 → 9999 and 18 → 19 are darker. The added space is not colored
Character2 removed / 4 added5678 → 9999, 8 → 9 and the added space are darker

With "Line", the 2 lines in Before count as removed and the 3 lines in After count as added. With "Word" and "Character", each changed spot is counted. "Character" also counts the added space as one spot, so it shows one more addition.

Text written without spaces between words, such as Japanese, is compared the same way. If you change 「会議は10時から会議室Aで行います。」 to 「会議は11時から会議室Bで行います。」, "Word" colors 10 → 11 and A → B, and "Character" colors 0 → 1 and A → B.

What does "Ignore whitespace" ignore?

We set the unit to "Line" and tried texts that differ only in spaces.

DifferenceOffOn
A space at the end of a line1 lines removed / 1 added0 lines removed / 0 added
A space at the start of a line1 lines removed / 1 added0 lines removed / 0 added
An extra space in the middle of a sentence1 lines removed / 1 added1 lines removed / 1 added
A space changed to a tab or a full-width space1 lines removed / 1 added1 lines removed / 1 added
An empty line was added0 lines removed / 1 added0 lines removed / 1 added

This is useful when you want to ignore differences in code indentation. Even on lines with different indentation, the color goes on the characters that actually changed. With the unit set to "Word", differences in spaces alone are not counted even when it is off.

Notes

Notes

Important points are grouped with reasons so you can make decisions before using the tool.

Counting

"Line" counts lines; "Word" and "Character" count changed spots

The same texts give different numbers at the bottom right when you change the unit. Line mode counts lines, while the other two count each changed spot.

Ignore whitespace

Only spaces at the start and end of a line are ignored

Extra spaces in the middle of a sentence, or a space replaced with a tab or a full-width space, still count as differences even when it is on.

Language

"Language" only sets the text coloring

It does not change how texts are compared. It makes code easier to read when you compare it.

FAQ

Questions about Text Diff Checker

Questions that make decisions easier before use are summarized first.

What is the difference between Line, Word and Character?

They color and count changes differently. "Line" counts the lines that changed, and for similar lines it also shows the characters that changed inside them. "Word" and "Character" count each changed spot. "Word" does not count differences in spaces alone.

What does "Ignore whitespace" ignore?

Spaces at the start and end of a line. Lines that differ only in indentation are treated as the same. Extra spaces added in the middle of a sentence, or a space replaced with a tab or a full-width space, still count as differences.

Can it compare text written without spaces between words, such as Japanese?

Yes. With "Word", the changed part is colored, such as 10 → 11 in 「10時」. With "Character", only the one character that changed is colored.

Can it compare long texts?

Even with two texts of 10,000 lines (about 270,000 characters) each, the differences were colored right away.

Can I use it to check code changes?

Yes. Choose JavaScript, TypeScript, JSON, HTML, CSS or another option in "Language" and the text is colored so it is easier to read. How the texts are compared stays the same.

Is the text I enter sent anywhere?

No. The comparison happens in your browser. What you enter stays only in this device's browser, so you can pick up where you left off when you open the page again.

Next guides

Related guides

Related guides are listed next so you can continue without getting lost.