Text and Code Diff
Compare two blocks of text or code line by line in a side-by-side view, ignoring whitespace or case when a config file throws up formatting noise.
After editing a config you want to know which lines actually moved, during review you want the shape of a change at a glance, and when two log extracts disagree you want the differing lines and nothing else. None of that needs a full IDE, but it does need an accurate diff - and a surprising number of online tools accept JSON only, which is useless the moment the content is a shell script or a SQL dump.
Paste both versions into the two panes and the comparison is line by line: additions, deletions and modifications are highlighted, and the header reports how many lines differ. Case and whitespace can be ignored to strip out formatting noise. The comparison happens in browser memory, so production configs, key files and unreleased code never leave the machine.
What a line diff actually computes
Text diffing is built on the longest common subsequence or the Myers algorithm: both sides are split into lines, the minimum set of insertions and deletions that turns one into the other is derived, and everything left over counts as unchanged. Because the algorithm only knows insertion and deletion, a block moved from one place to another is reported as two changes - a deletion where it used to be and an addition where it now is. That is why a diff can look larger than the edit you remember making: it describes the text, not your intent.
When to ignore case and whitespace
Comparing a config file across Windows and Linux usually produces a wall of false differences from CRLF against LF, trailing spaces, or tabs where the other side used spaces; ignoring whitespace first is the only way to see the real change. Files where indentation is syntax - YAML, Python, Makefile - need the opposite treatment, because the significant change may be exactly the indentation that the ignore option throws away. Ignoring case is useful for exported key names and environment variables from different systems, and rarely a good idea for code.
Why this is not a JSON-specific diff
A JSON-aware diff parses both sides into objects and compares them by key path, which distinguishes a changed value from a key that merely moved and is unaffected by formatting. Logs, SQL, shell scripts, Markdown and config fragments have no structure to parse, so line comparison is the only option that works on all of them. This tool deliberately stays at that level: it compares anything you paste, and in exchange it will not tell you whether two differently formatted fragments are semantically equivalent - for that you need a parser for the specific format.
Frequently asked questions
- How is text diff different from JSON diff?
- Text diff compares line by line with no parsing, so it accepts any input. A JSON diff parses both documents and compares by key, ignoring key order and indentation and naming the exact key whose value changed. JSON diff is sharper for API responses; line diff is the right tool for logs, SQL and code.
- Why does everything show as changed when only the line endings differ?
- Strict line comparison does not treat CRLF and LF as the same line, so every line on both sides is judged different. Ignore whitespace to filter that out, or normalize the line endings in an editor before comparing.
- I ignored whitespace and there are still many differences. Why?
- Usually one side is indented one level deeper overall, or a formatter reflowed the file and split long lines. Those are real differences at line level and no diff tool can merge them away; normalize both sides with the same formatter first, then compare what is left.
- Is the text I paste uploaded anywhere?
- No. The diff is computed in browser memory and no request carries the content. Comparing production configuration, credentials or private source is safe, and the text is gone when the page is reloaded - it is not written to local storage either.