Text Diff Checker
Paste two versions of any text (code, config, essays, anything), hit Compare, and get a color-coded side-by-side diff with exact additions and deletions. The diff engine runs on the server, so even large documents are compared with a robust longest-common-subsequence algorithm.
Sử dụng Text Diff Checker
Công cụ kiểm tra sự khác biệt giữa các văn bản
Dán hai phiên bản của bất kỳ đoạn văn bản nào, nhấn nút “So sánh” và xem chính xác những gì đã thay đổi — từng dòng một, kèm theo số lượng nội dung được thêm vào và xóa bỏ.
Bản gốc
Đã sửa đổi
Kết quả so sánh
Đọc nội dung
What Is the Text Diff Checker?
The Text Diff Checker compares two blocks of text and shows you the difference line by line. Paste the original version on the left, the changed version on the right, press Compare, and the tool returns a side-by-side view where removed lines are marked in red, added lines in green, and unchanged lines stay as context. A pair of counters tells you how many lines were added and how many were removed.
It works on any line-based text: source code, JSON, YAML, CSV, configuration files, essays, emails, legal clauses or a prompt you edited twice. The comparison runs on the server with a longest-common-subsequence algorithm, which is the same family of method used by classic diff tools, so the result is exact rather than a rough guess.
Why You Would Use It
Reviewing changes by eye is unreliable. In a long document it is easy to miss a line that was quietly deleted, and in code a single changed condition can be invisible between two large blocks. A diff removes the guesswork and lets you focus on what actually moved.
Developers use it to review a patch without opening an editor, QA engineers use it to compare an expected output with an actual one, writers use it to see what an editor changed in a draft, lawyers and operations teams use it to spot a clause that changed between contract versions, and students use it to check what changed between two answers. If you have ever asked what exactly is different between these two files, this is the tool for that.
How This Tool Works
The page opens with two editors side by side. The left card is labelled Original (Before version) and the right one Modified (After version); each has a Paste button that reads from your clipboard. Under them sit Sample (loads a small JavaScript example with a few edits already applied), Swap (exchanges the two sides) and Clear (empties both), plus the Compare button.
When you press Compare, the tool first checks that you did not leave both sides empty, then posts the two texts to the diff endpoint. The server validates the payload, counts the lines on both sides, and refuses the request if the combined total is above 1,500 lines. Otherwise the text is normalised (Windows and old Mac line endings become standard newlines), split into lines, and compared.
The algorithm builds a table of longest common subsequence matches and walks it to produce an ordered list of lines. Each line comes back as context, added or removed, with its line number on the old side, its line number on the new side and a prefix of a space, a plus or a minus. The response also carries the addition and deletion counts.
The page then shows the counters as pills: a green pill with the number of added lines, a red pill with the number of removed lines, or a grey pill saying the texts are identical. The result itself renders in a read-only Monaco diff editor, side by side, with line numbers and word wrap, and the theme follows the light or dark mode of the site. If the editor library fails to load, the tool falls back to a plain monospaced list with the same colours and line numbers, so you still get a usable result. Errors such as a payload over the limit appear as a red pill above the result.
Key Features
- Side-by-side diff view with line numbers on both sides
- Colour coding: red for removals, green for additions, plain for context
- Addition and deletion counters in a summary pill row
- Identical-text detection with a clear message
- Server-side longest-common-subsequence comparison for exact results
- Sample, Swap, Clear and per-side Paste controls
- Plain-text fallback view if the editor library cannot load
- Handles Windows, Mac and Unix line endings consistently
How to Use the Tool
- Paste the earlier text into the Original editor and the later text into the Modified editor, or click Sample to load an example pair.
- Use Swap if you pasted them the wrong way round, or Clear to start again.
- Click Compare. A spinner shows while the request is running.
- Read the pills for the change counts, then scroll the diff view to inspect each changed region.
- If the texts are identical, the tool says so and no diff view is needed.
Limits and Rules
Each side accepts up to 200,000 characters, and both sides must contain text; an empty side fails validation. The combined line count of the two inputs is capped at 1,500 lines, and anything above that is rejected with a message telling you the maximum, because the comparison cost grows with the product of the two line counts.
The comparison is line based, not character based: a change inside a line shows as one removed line and one added line rather than a highlighted word. Line endings are normalised before comparison, so a file saved with Windows line endings and the same file with Unix endings compare as identical rather than as a full rewrite.
Your two texts are sent to the server over HTTPS for the comparison. The endpoint is rate limited to 30 requests per minute per client, and it does not keep a copy of what you send, and this tool route carries no request-tracking middleware. Do not paste material you are not allowed to transmit.
When to Use It and When Not to
Use it to review a patch, check what an editor changed, compare two runs of a script, verify a regenerated config, or confirm that a translation did not drop a paragraph. It is also a quick sanity check before you commit or publish something.
Do not use it for files above the 1,500 line combined limit; split the work or use a local diff tool instead. It compares plain text only, so it will not render a PDF or an image, and it does not merge changes or resolve conflicts for you. Because the comparison is line oriented, a single changed word inside a long line is reported as a changed line rather than a changed word.
Câu hỏi thường gặp
Bình luận (0)
Hãy mô tả vấn đề mà bạn gặp phải để chúng tôi có thể tìm hiểu và cải thiện công cụ này.