Why comparing texts matters
Comparing two versions of a text is an everyday task across many roles: reviewing changes in a contract before signing, approving a code PR, checking a translation didn't lose content, auditing a legal document between revisions, comparing expected vs actual API responses during testing. In all those cases the human eye fails on long texts. A diff tool turns minutes of manual work into seconds.
How a diff works
Conceptually, a diff finds the "longest common subsequence" (LCS) between two texts. Lines present in both are marked equal. Lines only in A are marked removed. Lines only in B are marked added. The result is presented line by line, color-coded: red for deletions, green for additions, grey for equal.
Typical use cases
- Code review. Although GitHub shows diffs automatically, sometimes you need to compare two snippets outside a PR.
- Legal contracts. Negotiated version vs final version: pinpoint changed passages.
- Translations. Confirm no paragraph was lost.
- Configs. Compare prod vs staging configs to find a bug source.
- Documentation. See what changed between two manual versions.
- Exported data. Compare two CSV or JSON exports to detect changed records.
Line-level vs character-level diff
This tool diffs by line. If text A says "Hello world" and B says "Hello worlds" (one extra s), they appear as two distinct lines: one added, one removed. For fine intra-line differences (typos, single word changes), character-level diff shows contrast better but is slower and noisier for long texts. Most professional tools (git, IDE diffs) do line first and optionally character within modified lines.
Tips for useful comparisons
- Normalize whitespace first. If one text has tabs and the other spaces, every indented line shows as a change. Convert both to one standard.
- Watch line endings. CRLF (Windows) vs LF (Unix) makes identical lines look different. Run both through a normalizer.
- For JSON, format first. Comparing two minified 200-line JSONs is unreadable. Format both with 2-space indent and re-compare.
- For HTML, consider a specialized diff. Structural changes are more meaningful than plain-text diffs.
Beyond basic diff
For advanced flows, more powerful tools exist. git diff in CLI with flags like --word-diff or --color-words gives precise diffs. diff-match-patch by Google is a JS library combining line, word and character diff. Beyond Compare and Meld are desktop apps with sophisticated UI. For the 95% case, a simple web tool suffices.
Privacy
Because the comparison runs in your browser, you can paste private contracts, proprietary code, personal data without risk. Genfy's server never sees the content. To verify, open DevTools and watch Network while comparing: zero requests to the server.