Text Tools

Text Diff Checker

Compare two text passages and highlight what changed.

Browser workspace
LOCAL PROCESSING

Input stays in this browser while you use the tool.

About this tool

The Text Diff Checker compares two versions of a text and shows you what is different between them. You give it an original version and a changed version, and it reports which lines were removed, which lines were added and which lines stayed the same. The result is called a diff, short for difference.

Checking differences by eye is slow and unreliable. A single changed word in a long document, a number that was edited in a contract or one altered line in a configuration file is easy to miss when you read two versions side by side. A diff does the comparison for you and points straight to the lines that need attention.

Diff tools are built on the same idea that version control systems such as Git use. They look for the longest sequence of lines that both versions share, and treat everything else as a change. Because of this, a line that was moved to another place is usually reported as one removed line and one added line, not as a move.

You can use the tool for any plain text: essays and articles, contracts and policies, product descriptions, translations, configuration files, code snippets or the output of two commands. The comparison runs in your browser, so your text is processed on your own device and is not sent to the BitToolsKit server.

Use cases

  • Review edits to a document. Compare the draft you sent with the version you received back, so you can see every change an editor or a colleague made.
  • Check a contract, a policy or terms and conditions. Find out exactly which clauses were changed in a new version before you sign or accept it.
  • Compare two versions of code or a configuration file. See which settings were changed between a working file and a broken one.
  • Check a copy against its source. Confirm that a text pasted into a content system, a form or an email matches the original.
  • Verify translations and rewrites. Compare an updated text with the earlier one to find sentences that still need to be translated or checked.
  • Compare structured data. Format two JSON files in the same way first, then compare them to spot the keys or values that differ.
  • Find accidental changes. Check whether a file that should be identical, such as a backup, a template or an export, really has not changed.

How to use

  1. Enter your original text and your changed text in the tool. Enter the original first, so that the tool treats it as the starting point.
  2. Click Run tool.
  3. Read the result in the Output box. It shows which lines were removed from the original, which lines were added in the changed version and which lines stayed the same.
  4. Go through the lines that were reported as changed, one by one. If no changes are reported, the two texts are identical.
  5. Click Copy output to copy the result, or Download to save it as a file.
  6. Click Clear to empty the boxes and start a new comparison.

For the clearest result, compare texts that are laid out in the same way. Put one sentence or one item on each line, because a comparison usually works line by line.

Examples

Example 1: One line changed

Original text:
Apples
Bananas
Cherries

Changed text:
Apples
Blueberries
Cherries
What a diff reports:
Bananas was removed.
Blueberries was added.
Apples and Cherries are unchanged.

Example 2: A line added

Original text:
Dear customer,
Your order has shipped.

Changed text:
Dear customer,
Your order has shipped.
It will arrive on Friday.
What a diff reports:
The line "It will arrive on Friday." was added.
The first two lines are unchanged.

Example 3: A setting changed in a configuration file

Original text:
port=3000
debug=true

Changed text:
port=8080
debug=true
What a diff reports:
port=3000 was removed.
port=8080 was added.
debug=true is unchanged.

Example 4: Lines in a different order

Original text:
red
green
blue

Changed text:
red
blue
green
What a diff reports:
A moved line is usually reported as removed in one place and added in another, because a diff compares lines and does not track moves.

Example 5: Identical texts

Original text:
Same text

Changed text:
Same text
What a diff reports:
No differences. Every line is unchanged.

Common errors

Every line is reported as changed, although the texts look the same

The texts probably use different line endings. Windows uses a carriage return and a line feed, while Linux and macOS use only a line feed. Copying both texts from the same program, or pasting them through a plain-text editor, usually fixes it.

Lines that look the same are reported as different

Invisible differences such as a trailing space, a tab instead of spaces or a non-breaking space make two lines different. Remove extra spaces at the ends of lines and make sure both texts use the same indentation.

The two texts are swapped, so additions look like deletions

The text you enter first is treated as the original, and the text you enter second as the changed version. If you enter them the other way round, added lines show up as removed and the other way round. Check the order of your two texts.

A small edit marks a whole long paragraph as changed

A line-based comparison treats a paragraph written as one long line as a single line, so any change inside it marks the entire line. Put each sentence on its own line before you compare, and the changed sentence stands out.

A moved paragraph is reported as removed and added

This is how a diff works. It does not track moves. Treat a matching removed and added block as a move, and check that the wording inside it did not change.

Curly quotes, dashes or special characters make lines differ

Word processors replace straight quotes with curly quotes and hyphens with longer dashes. To a diff these are different characters. Convert them to the same style in both texts before comparing.

Differences in capital letters count as changes

By default a comparison treats Hello and hello as different. If you want to ignore capitalisation, convert both texts to the same case first, for example with the Case Converter.

A tiny change is hidden in a very long text

Work through the reported lines in order and ignore the unchanged lines. For very large texts, compare them in sections so that the result is easier to read.

The result is hard to use for formatted data such as JSON on one line

A whole minified file is one line, so any change marks the entire line. Format both files with the same indentation first, for example with the JSON Formatter, then compare them.

Blank lines are counted as differences

An extra empty line in one text is a real difference to the comparison. Remove extra empty lines from both texts if they do not matter to you.

Frequently asked questions

What is a diff?

A diff is a list of the differences between two texts. It shows which lines were removed from the original, which lines were added in the new version and which lines stayed the same.

Does the order of the two texts matter?

Yes. A diff always compares an original with a changed version, so enter the original first. If you swap them, added lines appear as removed lines and the other way round.

Why is a moved paragraph reported as deleted and added?

A diff compares the order of lines and finds the longest part both texts share. It does not follow a line to a new position, so a moved block is reported as a removal in one place and an addition in another.

Can I compare code with it?

Yes, any plain text works, including code, configuration files and logs. For large projects, version control tools such as Git are better suited, but a quick check of two snippets is easy to do here.

Does it compare line by line or word by word?

Diffs are usually line-based, so a change inside a line marks that line as changed. If you want to find a single changed word, put one sentence or even one word on each line before you compare.

Why do two identical-looking texts show differences?

The most common causes are trailing spaces, tabs instead of spaces, different line endings and curly quotes instead of straight quotes. These are hard to see but count as real differences.

Does it ignore capital letters or extra spaces?

By default a comparison treats capital letters and spaces as part of the text, so Hello and hello are different. Convert both texts to the same case, or remove extra spaces, if you want those differences to be ignored.

Can I compare very long texts?

Yes, but the comparison happens in your browser, so very large texts can be slow. For a very long document, compare it in sections.

Is my text uploaded to a server?

No. The tool runs in your browser and works on your device. As a general habit, avoid pasting passwords, API keys or private tokens into any online tool.

Related tools

Share this page