TextCompare
Sign in

Compare Two Strings Online

Paste two strings to see the exact characters that were added, removed or changed.

Advertisement
Drop original file here or click to browse
Drop modified file here or click to browse
— removed — added · No comparison yet
0 of 0
Advertisement
Give Rating

Choose a face to continue

We read every message.

Compare two strings character by character

Paste two strings and this free string diff highlights the exact characters that differ, so a changed letter, a missing digit or an extra space is obvious at a glance. It works for single values such as IDs, hashes, URLs and file paths, and for longer multi-line text.

Leading and trailing spaces are ignored by default. Turn off Trim whitespace in the options to catch those too — they are easy to miss by eye.

How to compare two strings

  1. Paste the first string

    Paste it into the left editor.

  2. Paste the second string

    Paste the other one on the right.

  3. Click Compare

    The characters that differ are highlighted inside the line.

  4. Read the result

    If nothing is highlighted, the two strings are identical, including upper and lower case.

What the string compare tool does

  • Character-level highlighting

    Only the characters that changed are marked, not the whole string.

  • Case-sensitive

    Upper and lower case count as different, so “ABC” and “abc” do not match.

  • Whitespace control

    Trim whitespace ignores spaces at the start and end; turn it off to compare those too.

  • Multi-line strings

    Compare whole blocks of text: lines are matched first, then the changed characters are marked.

What people compare with the string tool

  • IDs and hashes

    Check that two checksums, UUIDs or order numbers really are the same.

  • URLs and paths

    Find the parameter or character that makes two URLs or file paths different.

  • Copied values

    See whether a value pasted from an email or a PDF picked up a hidden space or a look-alike character.

  • Test output

    Compare the string a test expected with the one it actually got.

Getting a cleaner comparison

  • They look identical but do not match

    One may hold a trailing space or a look-alike character from another alphabet. Turn off Trim whitespace and look for the highlighted character.

  • A very long single-line string

    Keep Word wrap on, as it is by default, so the whole string is visible without scrolling sideways.

Frequently asked questions about comparing strings

How do I check if two strings are exactly the same?

Compare them: if nothing is highlighted and there are no changes, the strings match, including case. Turn off Trim whitespace to also compare leading and trailing spaces.

Is the comparison case-sensitive?

Yes. “Hello” and “hello” are reported as different strings.

Can I compare multi-line strings?

Yes. Each line is compared, and the changed characters are marked inside it.

How do I compare strings in Java, JavaScript or Python?

In Java use a.equals(b), or a.equalsIgnoreCase(b) to ignore case. In JavaScript use a === b, and in Python a == b. Use this tool when you need to see where two strings differ, not just whether they do.

Is my data stored?

No, comparisons run entirely in your browser.

Advertisement
enardeesfriditjakopt