Why Two Strings Look the Same and Do Not Match

When two strings look identical and a comparison fails, inspect the code points first. Remove only the invisible marks the tool lists, or clean ordinary whitespace if that is the difference.

Last updated: October 7, 2026

The problem

Two strings look the same. A comparison, a search, or a diff says they are not. You can stare at “hello” and “hello” and learn nothing, because the difference may be a character that does not paint. Two strings look the same on screen is the symptom. The next step is to read the code points, then change only the characters you have identified.

Three pages cover three different jobs. The Unicode Code Point Inspector shows what is in the paste. The Invisible Character Remover deletes a pinned set of marks and tells you how many of each it deleted. The Whitespace Cleaner trims ends, collapses runs of horizontal whitespace, normalizes line breaks to LF, and collapses extra blank lines. None of them is a general Unicode sanitizer. None of them folds lookalike letters into one letter.

Why the screen is not the string

Equality compares code points, not the pixels you see. A zero-width space between two letters does not open a gap, so both strings still look like one word. A trailing ordinary space does open a gap if you select the text, and it still fails equality against the copy that has no trailing space. Those are different defects. Deleting “invisible stuff” without looking will either miss the space or strip a mark you needed.

Inspect the code points

Paste each string into the inspector. Each row is one code point: an index, a glyph or the words “not visible,” and the code point as U+ hex. A name appears only when that character is on the short list shipped with the page. Every other row says there is no name in this tool. Read the hex. Do not wait for a familiar name.

A useful pair is hello and hel plus U+200B plus lo. The second paste looks like hello. One row is not visible, and the hex is U+200B, ZERO WIDTH SPACE. That is the whole diagnosis for this pair. You do not need a second theory until the rows disagree with it.

Remove a listed invisible mark

If the extra code point is on the remover’s default set, turn that set on and run it. The default set is U+00AD soft hyphen, U+180E Mongolian vowel separator, U+200B zero-width space, U+2060 word joiner, and U+FEFF zero-width no-break space, also used as a byte-order mark. The page counts how many of each it deleted. A run that deletes none is still a success: the count is zero and the text is unchanged.

Leave the joiner option off unless you mean to remove U+200C zero-width non-joiner and U+200D zero-width joiner. Those two can change how Arabic, Persian, Indic, and other scripts shape. They are not part of the default set for that reason. Ordinary spaces, tabs, newlines, and no-break spaces stay. Bidi controls stay. The page does not hunt homoglyphs, and it does not rewrite lookalike letters.

On the hello example, the default set removes one U+200B. The result is the five letters, and it matches the other string. If the inspector showed a different hex, do not keep clicking Remove and hope the default set grows.

Clean ordinary whitespace

Use the whitespace cleaner when the inspector shows spaces, tabs, or a line-break difference, not a zero-width mark. The checked options trim the ends, collapse repeated horizontal whitespace to a single space, turn CR and CRLF into LF, and collapse three or more blank lines to one blank line. hello world with two spaces becomes hello world. A trailing space on hello goes away when trim is on.

That is not the remover. The cleaner does not delete U+200B, the soft hyphen, or the word joiner. Running it on the zero-width hello leaves the hidden mark in the word. Running the remover on a double space leaves the double space, with a removed count of zero. Match the tool to the row you just read.

Confirm, and stop when the tools do not apply

  1. Inspect both strings and note every row that the other string does not have.
  2. If the extra row is in the remover’s default set, remove that set and read the count.
  3. If the extra row is ordinary spacing or a different line break, clean whitespace instead.
  4. Inspect the result, or compare it to the string you trust. The hidden row should be gone, or the spacing should match the option you checked.

Stop if the code points are both visible and simply different characters, or if one string uses a composed letter and the other uses a base letter plus a combining mark. These three tools will show you that. They will not pick a winner. A Cyrillic letter that looks like a Latin letter is a different code point, and neither the remover nor the cleaner will fold it. Bidi marks are outside the remover’s sets. If the inspector’s hex is not on the list above, and it is not ordinary whitespace, you do not have a fix on these pages yet. You do have the code point, which is the part the screen withheld.

On this page

Related solutions

Related guides

Related articles

Need a tool for this ?

Open the free tools — no signup.

FAQs

newsletter signup

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.