Bahasa: Bahasa Indonesia

Pembanding teks

Berjalan di browser ini. Tidak ada yang Anda masukkan dikirim ke Alinxs.

Pintasan: Ctrl atau ⌘ + Enter di salah satu kotak.

Unified diff selalu membandingkan teks persis, termasuk spasi, huruf besar-kecil, dan pemisah baris terakhir.

Pengaturan disimpan di penyimpanan lokal browser ini agar siap dipakai lagi.

Practical guide

Text Diff Checker — Compare Two Texts Line by Line

Use this checker when you have two versions of the same text — a contract draft, a translation, a configuration file, a list or a code snippet — and need to see exactly which lines changed. Removed lines are marked with −, added lines with +, and words that changed inside a replaced line are highlighted, so the result does not depend on colour alone.

How to use it

  1. Paste the earlier version into Original text and the later version into Changed text.
  2. Optionally tick “Ignore differences in spaces and tabs” or “Ignore upper and lower case”, then select Compare (or press Ctrl or ⌘ + Enter).
  3. Read the counts and the line-by-line result. Copy unified diff copies a standard patch you can paste into a review or apply with patch.

Worked example

Input
Original: a / b / c / d — Changed: a / x / c / d / e (one item per line)
Result
Removed 1 (b), added 2 (x, e), unchanged 3 (a, c, d). The unified diff has one hunk: @@ -1,4 +1,5 @@.

How the result is produced

Line endings are normalized to \n and each text is split into lines. The page finds the smallest set of removed and added lines with the Myers O(ND) difference algorithm — the same minimal approach used by diff and Git — after setting aside identical lines at the start and end.

In each changed block the first removed line is paired with the first added line, the second with the second, and so on. Paired lines are compared word by word (runs of letters and digits, runs of spaces, and single punctuation marks, symbols and emoji; Chinese and Japanese characters one by one), never splitting a character such as 👍🏽 or a flag, and the changed words are highlighted.

The unified diff uses --- original and +++ changed headers and three lines of context. It always compares the exact lines — the ignore options affect only the on-screen view — and, as in GNU diff, a last line without a final line break is marked \ No newline at end of file. Applying it with patch or git apply to the original recreates the changed text, with Windows (CRLF) and old Mac (CR) line endings converted to \n.

Important limits

  • Each text can have up to 5,000 lines and 300,000 characters (Unicode code points, counted after line endings are converted). Comparison stops when more than 2,000 lines would have to be removed or added in total; the exact comparison behind the copied diff has the same limit, so with ignore options on the screen can show a result that cannot be copied. Word highlighting is skipped for a changed line with more than 400 words, spaces and symbols, and the page says so. Split larger files into sections.
  • Moved blocks are shown as a removal plus an addition; there is no move detection, three-way merge, file upload or character-level diff for lines that are not paired.
  • Ignore options change only the on-screen comparison; the copied unified diff still includes whitespace and case changes. On screen, a missing line break at the very end is not counted as a changed line but is always noted, also when ignore options hide every other difference. Line endings are converted to \n, so the diff cannot show CRLF-only differences.

Questions and answers

Are my texts stored or sent anywhere?

No. Both texts are compared in this browser tab and are not saved; only the three option checkboxes are kept in local storage. Reloading the page clears the texts.

Why is a line shown as removed and added when only one word changed?

Diffs work on whole lines. The changed words inside the pair are highlighted so you can see the actual edit.

What does “Ignore differences in spaces and tabs” do?

Like diff -b: trailing spaces and tabs are dropped and every other run of spaces or tabs counts as a single space, so lines that differ only in the amount of existing spacing (for example 4 spaces versus a tab) compare as equal. Adding spacing where there was none — indenting an unindented line, or ab versus a b — is still a change, and other characters such as non-breaking spaces always count.