Text compare online
Learn how browser-based text comparison works, what it actually checks, and how to choose a method that matches stored characters, appearance, and safe handling.
What this comparison actually checks
A browser-based text comparison inspects two inputs and reports where they differ. The sources stay as they were unless a separate step also rewrites them. The output is a difference report: units that changed, were inserted, or were deleted.
The report is only as meaningful as the unit being compared. The same pair of samples can look nearly identical in one mode and fully divergent in another.
- Code points or characters: each stored character is compared in order.
- Unicode normalization form: composed and decomposed spellings of the same letters can differ before normalization and match after it.
- Words or tokens: spacing and punctuation may be grouped, which hides tiny edits inside a larger replacement.
- Lines: a one-character edit is reported as a whole-line change, which is easier to scan in prose or code.
- Rendered glyphs: a visual check compares appearance and can ignore stored-character differences that look the same.
Character-order reversal is a stored-sequence change. A compare of “hello” and “olleh”, aligned from the start, flags a different character in almost every position. That result describes order in memory. It is a different mechanism from flipping how letters are drawn on screen.
Reversal, mirroring, substitution, and display
Several effects can make two samples look related while a stored compare treats them as different, or look different while a stored compare treats them as the same. Ambiguous labels such as “mirror text” mix these effects, so it helps to name the mechanism.
- Character-order reversal rearranges the stored sequence. “mirror” stored backwards is “rorrim”. Meaning is recovered by reversing the sequence again.
- Visual mirroring changes how glyphs face. CSS presentation can draw the original string flipped while leaving storage unchanged, so a character compare still sees the original letters. Unicode characters that resemble mirrored letters change storage, so a character compare reports a difference.
- Unicode substitution includes homoglyphs, such as a Latin letter and a lookalike from another script. They can appear identical in a side-by-side pane and still fail an exact compare.
- Bidirectional display (right-to-left marks and embedding controls) can reorder what you see relative to logical storage. Tools that compare stored order follow the logical sequence. A visual scan of the pane can disagree with that report.
- CSS presentation—color, font, scale, or flip—is outside the string. Copied plain text from a styled pane compares as the underlying characters.
The following pairs use matched inputs. Outputs are illustrative of the mechanisms above; they are not observed results from a named service.
| Stored input A | Stored input B | Character compare (illustrative) | Visual impression (illustrative) |
| hello | olleh | Different characters in sequence | Same letters in reverse order |
| hello | hello shown with a CSS flip | Identical stored text | Mirrored appearance |
| cafe plus a combining accent | café as a single precomposed character | Difference until Unicode normalization | Often the same word |
| Latin a in “a” | A lookalike letter from another script | Difference at that position | May look identical in many fonts |
Pair 1 (reversal of stored order)
A: hello
B: olleh
Pair 2 (same letters, different encoding of é)
A: cafe\u0301
B: café
Which comparison method fits the result you need
Choose by the question you need answered: whether the two samples are the same data, whether a reader would see the same thing, or whether an edit is easy to review. Appearance, stored characters, editability, and reversibility pull in different directions.
| Approach | Appearance | Stored characters | Editability | Reversibility | Serves |
| Exact character or code-point compare | Can disagree with on-screen layout when fonts, bidirectional controls, or styling intervene | This is what it measures | Both sources remain ordinary text; the report is extra | The same algorithm on the same inputs yields the same report | Hidden characters, homoglyphs, accidental reversal, copy errors |
| Normalized compare (Unicode NFC or NFKC, optional whitespace collapse or case folding) | Closer to matching intended letters | Each side is rewritten by a defined rule before the check | Sources stay intact if normalization is only for comparison | You need a record of which normalization ran | Copy that should match in visible letters and wording |
| Word- or line-oriented diff | A readable change list | Small in-line edits can be summarized as larger blocks | Suited to reviewing prose or code | A line-preserving diff can often be applied as a patch | Editorial review |
| Rendered or visual compare | This is what it measures | Ignored when glyphs match | Usually an overlay or image, not a patch | Depends on renderer and font | Layout, mirrored presentation, “does this look the same” |
Tradeoffs follow from that table. Exact compare is noisy on rewrapped paragraphs and on whitespace-only edits. Normalization can hide encoding differences you needed to find. A word-level diff may show a reversed token as a full-word replacement, which is accurate and coarse. A visual check misses homoglyphs and can flag font or anti-aliasing differences that are absent from the text.
- To confirm that a mirrored or flipped look is only presentation: compare the plain copied characters. Matching storage means the effect was styling. Differing storage means reversal or substituted characters were encoded in the string.
- To catch lookalike substitution: use exact stored comparison and inspect code points. A visual-only check can miss the swap.
- To review writing: use a word- or line-level diff, with optional whitespace ignore. Exact character compare of wrapped paragraphs produces a large report that is hard to edit against.
Readability, paste, and where the result still works
A compare view often adds highlighting markup. Pasting into a plain-text field typically keeps the words and drops colors and insertion marks. Pasting into a rich-text editor may keep spans, so the destination shows the original wording plus leftover formatting. Treat the two source fields as the durable text. Treat the highlighted pane as a view of that text.
What survives a transfer depends on what you copy. The source strings survive when copied from the input fields. Highlighting, connectors, and “moved” annotations often drop away. Unicode controls such as bidirectional marks and zero-width joiners typically remain in an ordinary plain-text paste and continue to affect both display and later compares at the destination. CSS-only mirroring is absent from a plain-text paste. These clipboard patterns vary by browser, operating system, and editor; check the destination when the transfer matters.
Assistive technology reads stored characters and the page’s text alternatives. A side-by-side layout may be announced as two sequences in document order, which is hard to follow as a change list. Difference coloring without a non-color cue (labels such as “inserted” or “deleted”) leaves some readers without the signal. Those outcomes depend on how a given page is marked up, so they are not universal.
Fonts that lack a glyph may show a replacement box. A visual scan can then report a difference that a character compare does not, or hide a homoglyph that a character compare catches. Bidirectional controls can also render differently across editors. “Looks the same here” is a statement about this renderer and this font. When hidden characters are a concern, paste both sides into the place they will be used and compare again, or inspect code points.
An online compare sends both sides to whatever process the page runs, which is often a remote service. Keep passwords, secrets, personal records, and unpublished confidential copy out of an external compare field. A local editor or an offline diff is the safer path for sensitive content. For public snippets, a browser-based check is a reasonable convenience.
A plain-text alternative is to paste both samples into a local editor that can show invisibles (spaces, tabs, line endings) or code points. That keeps the data on the device and makes hidden characters inspectable.
Gaps: this guide does not document a named site or claim a particular application’s output. Illustrative pairs above are mechanism examples. Clipboard, font, and assistive-technology behavior need a check in the actual browser, editor, and page markup you will use.