Developer Công cụ đã được cập nhật 4 ngày trước

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.

Luôn miễn phí Dễ sử dụng Kết quả ngay lập tức Riêng tư và an toàn

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

Trước phiên bản

Đã sửa đổi

Sau phiên bản

Kết quả so sánh

So sánh song song
Tối đa 1.500 đường dây tổng cộng
Dán hai phiên bản vào và nhấp vào “So sánh” để xem sự khác biệt.
So sánh…
Liên kết công cụ
Đã sao chép vào khay nhớ tạm.
Hãy giúp cải thiện công cụ này

Đọc nội dung

Tìm hiểu cách thức hoạt động của công cụ này và khi nào nên sử dụng nó.

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

  1. Paste the earlier text into the Original editor and the later text into the Modified editor, or click Sample to load an example pair.
  2. Use Swap if you pasted them the wrong way round, or Clear to start again.
  3. Click Compare. A spinner shows while the request is running.
  4. Read the pills for the change counts, then scroll the diff view to inspect each changed region.
  5. 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

Các câu trả lời ngắn gọn cho những thắc mắc mà người dùng thường đặt ra trước khi tin tưởng vào kết quả.

It compares two texts line by line and highlights which lines were added, removed or left unchanged, so you can review edits to code, documents or configuration files quickly.

Yes. The two texts are posted to the diff endpoint over HTTPS and compared there. They are not stored, and this tool route carries no request-tracking middleware.

200,000 characters per side, with a combined limit of 1,500 lines. Larger inputs are rejected to keep comparisons fast.

The green pill counts lines present only in the modified text, and the red pill counts lines present only in the original text.

Yes. Any line-based text works, including source code, JSON, YAML, CSV and plain prose.

The comparison is line based, so an edited line is reported as one removal and one addition rather than a highlighted word.

Bình luận (0)

Dành cho các cuộc thảo luận của người dùng, các trường hợp ngoại lệ và các mẹo bổ sung.
Để lại bình luận
Bình luận của bạn sẽ được hiển thị công khai sau khi gửi.
Chưa có bình luận nào. Hãy là người đầu tiên bình luận!
Hãy cho chúng tôi biết!
Báo cáo sự cố liên quan đến công cụ này

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.

Điều gì hữu ích nhất
Vui lòng cung cấp thông tin về dữ liệu đầu vào, kết quả mong đợi, kết quả thực tế, trình duyệt/thiết bị và ảnh chụp màn hình (nếu có thể).
Nút chụp màn hình sẽ chụp lại trang web trong trình duyệt và đính kèm hình ảnh được tạo ra vào biểu mẫu này.
Ảnh chụp màn hình toàn trang
Được ghi lại trên trình duyệt của bạn bằng newisty.
Chưa có ảnh chụp màn hình nào được chụp.
Công cụ Báo cáo