← Compare

Whitespace, line endings and invisible differences

Two files can look alike and still have different characters. The most common causes are tabs, extra spaces, different line-ending conventions and a missing final newline. Understanding these helps you choose useful comparison options without hiding important changes.

What Ignore spacing does

DiffTidy collapses each run of horizontal spaces and tabs into a single space and trims whitespace at the beginning and end of the line for matching. It includes normal space and nonbreaking space. It does not remove every separator: “a b” and “ab” remain different. Blank lines are not discarded, and the original text itself is never rewritten.

LF, CRLF and CR

Line feed (LF) is common on Unix-like systems. Carriage return plus line feed (CRLF) is common in Windows text files. CR alone also appears in older content. A file opened directly retains these endings in memory. The browser may normalize endings while you type or paste in a textarea. Labels such as LF, CRLF and EOF indicate differing endings in comparison results.

The final newline

“hello” and “hello” followed by a newline are not identical strings. With Ignore line endings enabled they may match on screen, but the patch still records the exact difference. Disable that option when checking generated files, line-based protocols or repository formatting requirements.

Unicode and case

Visually similar characters can use different code points, and combining marks can produce similar-looking strings. DiffTidy does not normalize Unicode automatically. Character highlighting uses grapheme segmentation where the browser supports it, so many emoji and combined characters stay together visually. Ignore case uses Unicode lowercase conversion rather than a language-specific collation rule.

Inspect your text