String Utilities Công cụ đã được cập nhật 3 tuần trước

Markdown Diff Viewer

Compare an original and an updated Markdown document line by line. Paste both versions, press Diff, and see added lines marked with a plus, deleted lines with a minus, and unchanged lines in context, with counts for each. The comparison runs in your browser and the diff can be copied or downloaded as text.

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 Markdown Diff Viewer

Trình xem sự khác biệt Markdown

So sánh bản gốc và bản cập nhật của Markdown theo từng dòng, với các phần được thêm vào và xóa đi được hiển thị rõ ràng.

Markdown gốc

Trước phiên bản

Markdown đã được cập nhật

Sau phiên bản
Chưa so sánh
Trạng thái Diff
0 đã thêm
Các dòng đã thêm
0 đã xóa
Các dòng đã bị xóa

Kết quả so sánh

So sánh từng dòng
Chạy lệnh diff để xem các thay đổi tại đây.
Mẹo về độ lệch
Đây là một bản so sánh dòng đơn giản, không phải là bản so sánh Git đầy đủ. Các dòng được thêm vào sử dụng +, cách sử dụng các dòng đã xóa -, và các dòng không thay đổi được giữ nguyên.
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ó.

See exactly what changed between two Markdown versions

You have an old README and a new one, a draft and an edited draft, or the text an AI assistant gave you yesterday and the version it gave you today. Reading both side by side to spot the differences is slow and error-prone. The Markdown Diff Viewer lines the two versions up and marks every line that was added or removed, so you can review an edit in seconds instead of minutes.

The viewer is built for Markdown, but because it compares plain lines of text it works just as well for any line-based file: changelogs, YAML config, plain notes, CSV rows or code.

How the comparison works

Both inputs are split into lines. The tool then computes the longest common subsequence of lines, which is the largest set of lines that appear in both versions in the same order. Those lines are treated as unchanged. Every other line in the original is marked as deleted, and every other line in the updated version is marked as added. This is the same basic idea that classic diff programs use, applied to whole lines.

Lines must match exactly to count as unchanged. A single extra space, a changed letter or a trailing tab makes a line different, and it appears as one deletion plus one addition. Where a single line was edited in place, the old version normally appears first with a minus sign and the new version follows with a plus sign.

The whole comparison runs in your browser. Neither version is sent to this site's server.

Reading the result

The Diff Result card shows every line of the comparison in order, in three styles:

MarkerMeaningLine number shown
+Line exists only in the updated version (added)Its line number in the updated version
-Line exists only in the original version (deleted)Its line number in the original version
blankLine is identical in both versionsIts line number in the updated version

Above the result, three status cards summarise the outcome. Diff status reads "Not compared yet", "Changes found" or "No changes". Added lines and Deleted lines give the counts. The footer shows the length of the raw diff and the total number of compared lines.

The diff is a full view rather than a trimmed patch: unchanged lines are kept so you can see each change in its surrounding context. There are no @@ hunk headers.

Step-by-step

  1. Put the older text into Original Markdown (the "Before version"). You can type, paste with your keyboard, or press Paste Original in the header.
  2. Put the newer text into Updated Markdown (the "After version"), or press Paste Updated.
  3. Check the character and line counts under each editor to confirm you pasted the full documents.
  4. Press Diff.
  5. Scroll through the Diff Result. Red minus lines were removed, green plus lines were added.
  6. Press Copy Diff to copy the plain-text diff, or Download to save it as markdown-diff.txt.

Each editor has its own copy button, Copy Original and Copy Updated. Clear empties both editors and the result. Typing in either editor after a comparison resets the result, so press Diff again whenever you change something.

The plain-text diff format

Copy Diff and Download both use the same simple format: one line per compared line, starting with +, - or a space, followed by the line content. For example:

# Project
-Version 1.2 is out.
+Version 1.3 is out.
## Install

This reads naturally in chat, email or a code review comment. It is not a full unified patch, so tools like git apply or patch will not accept it as-is.

Who finds it useful

  • Technical writers reviewing an editor's changes to a documentation page before publishing.
  • Developers comparing two copies of a README or changelog without opening a terminal or creating a commit.
  • Content teams checking what a translator, client or reviewer changed in a Markdown article.
  • People working with AI writing tools, who often get a slightly different answer on each run and want to see what actually moved.
  • Students and researchers tracking edits between drafts of notes written in Markdown.

Getting a clean, meaningful diff

  • Normalise formatting first. If one version was run through a formatter and the other was not, nearly every line may differ. Format both the same way, then compare.
  • Watch for trailing spaces. They are invisible but make lines unequal. If a line looks identical yet shows as changed, trailing whitespace is the usual cause.
  • Remember that line endings are normalised. Windows and old Mac line breaks are converted to plain line feeds, so a file saved on Windows compares cleanly with the same file saved on Linux.
  • Hard-wrapped paragraphs exaggerate changes. If one version wraps at 80 characters and the other uses one line per paragraph, rewrap one of them so the lines line up.
  • For long documents, compare a section at a time. The result is easier to read and the comparison finishes faster.

A quick review routine

For an edit review, start with the counters rather than the full list. If Added lines and Deleted lines are both small, read the marked rows one by one. If both are large and roughly equal, the change is probably formatting, such as rewrapped paragraphs or converted list markers, and normalising both versions first will give you a much shorter, more useful diff. If only Added lines is large, someone has written new sections, so jump to the green blocks.

What not to use it for

  • Do not expect word-level or character-level highlighting. A one-word edit shows the whole line as removed and re-added.
  • Do not treat it as a merge tool. It shows differences but cannot combine two versions or resolve conflicts.
  • Do not use the downloaded text as a patch file for version control.
  • Do not expect rendered output. The viewer compares the Markdown source, not the formatted page.

Limitations

  • Line-based comparison only, with exact matching including whitespace and letter case.
  • The algorithm builds a table the size of the two line counts multiplied together. Very large files, tens of thousands of lines each, can make the browser slow or unresponsive. Split them into parts if that happens.
  • Moved blocks are shown as a deletion in one place and an addition in another; moves are not detected as such.
  • There is no side-by-side layout, ignore-whitespace option or context-trimming option in the current interface.

Related tools

If formatting noise is hiding the real changes, run both versions through the Markdown Beautifier first, then compare. To see how either version renders, open it in the Markdown Previewer.

Frequently Asked Questions

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ả.

Whole lines. Any change inside a line, even one character, shows that line as deleted from the original and added in the updated version.

Lines must match exactly. Trailing spaces, tabs, different quote characters or a change in letter case all make lines unequal.

No. Both versions are compared in your browser with JavaScript and nothing is sent to this site's server.

No. The download, markdown-diff.txt, lists every line with a plus, minus or space prefix but has no patch headers, so it is meant for reading and sharing, not for applying.

Added and unchanged lines show their number in the updated version. Deleted lines show their number in the original version.

There is no fixed limit, but the comparison table grows with the product of both line counts, so very long files may slow the page down. Compare large documents in sections.

Yes. It compares plain lines of text, so changelogs, config files, CSV data and code all work in the same way.

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