Markdown Diff Online
Compare Markdown documents and find differences instantly.
When a Markdown diff is the right tool
Markdown is how a lot of documentation and copy moves around: a README, a changelog, a docs page, or a blog draft. Two versions can look almost the same in a preview and still disagree in a heading, a code sample, or a table cell. A Markdown diff is for that moment. You put the previous source on the left, the new source on the right, and read every added, removed, or replaced line instead of scanning both files by eye.
This page compares the source you paste, not the rendered HTML. It does not preview the page and it does not treat * and _ as the same emphasis. If you only need to see a single document rendered, use Markdown Preview. If you want a word-level view of a prose change, the homepage text diff has a word mode. If the file already lives in Git, git diff is usually the better tool once the change belongs in a repository.
Use cases
Reviewing a README or a docs page
A Getting Started page often changes in a few places at once: a new install command, a rewritten code sample, and an extra table row. Pasting both versions makes each of those a marked line, so a review can confirm the intended edit without rereading the unchanged headings. Load Sample on this page uses that kind of short document.
Checking a table or a fenced code block
Tables and fences are still lines of text. A single cell edit shows up on that row, and a change inside a fence shows up on that line of code. If someone only realigned the table pipes, every padded row can light up even when the cell values did not change.
Comparing a draft that was never committed
Copy from a ticket, an email, or an exported wiki page often never becomes a pull request. Pasting both versions here is faster than creating a throwaway repo, as long as you remember that equivalent Markdown syntax will still look like a change.
How the comparison works
When you choose Compare, the two panes are compared line by line, using the same style of alignment you see in a typical unified or split diff. Identical lines stay across from each other. A line that exists only on the left is marked as removed. A line that exists only on the right is marked as added. You can switch between split and unified views, and copy the unified result if you need a record.
There is no Markdown parser and no ignore-formatting option. Spaces, list markers, emphasis characters, and fenced-code language tags are all part of the text.
## Usage
Import and use in your project:
```js
const pkg = require('my-package')
pkg.init({ debug: false })
```
## Usage
Import and use in your project:
```js
import { init } from 'my-package'
init({ debug: true, timeout: 5000 })
```The heading and the intro line stay unchanged. The fence stays a JavaScript fence, but the lines inside it are marked as replacements. That is the kind of sample edit this page is meant to make obvious.
You can use *italics* or a list:
- apples
- pears
You can use _italics_ or a list:
* apples
* pearsThese two fragments often render the same: italics, then a list. The source uses different emphasis markers and list bullets, so a line diff reports a change. If that is the only difference you see, the documents are probably the same for a preview. Use Markdown Preview when you need to confirm the rendered result.
What this tool does not do
It does not render Markdown, lint the file, or compare a computed HTML tree. It does not ignore equivalent syntax, and it does not treat a table as cells. Nothing is sent to a server. Very large documents can still be pasted, but they may make the tab feel slow. To convert a file to HTML first, use Markdown to HTML, then compare the output on HTML Diff if that is the artifact you care about. For heading and formatting issues in a single file, try the Markdown Linter.
How to use Markdown Diff
- Paste the older or expected Markdown into the original pane.
- Paste the newer Markdown into the modified pane.
- Choose Compare. Switch between split and unified views, and copy the result if you need to keep a record.
- Use Swap if the sides are reversed, Clear when you are finished, or Load Sample to try a short README-style example first.
Frequently asked questions
Does Markdown Diff render the documents or compare the HTML?
No. The two panes are compared as source text, line by line. The page does not run a Markdown parser, show a preview, or compare the rendered HTML. Two files that look the same in a preview can still differ here if the source uses different syntax or spacing.
If one file uses *italics* and the other uses _italics_, will they look identical?
Not in this tool. Those forms often render the same, but a line diff treats the characters as different. The same is true of - versus * in a list, ATX versus Setext headings, or a table whose column padding changed. Compare the source you care about, or ignore those lines as formatting.
Can I compare README files, docs, or a table?
Yes. Paste the full Markdown, including fenced code, tables, and front matter. A table is still compared as lines, so a single cell edit can also shift padding on that row. Load Sample uses a short Getting Started page if you want to try a heading, a fence, and a table change first.
Is my Markdown sent to a server?
No. Comparison runs in your browser. Closing the tab discards what you pasted. Do not paste documents that contain secrets or unpublished copy if you would not be comfortable with them sitting in memory on this device.
Is there a file size limit?
There is no server-imposed limit, because nothing is uploaded. A few thousand lines is comfortable. A very large book or generated document can make the page feel slow; in that case, compare a smaller chapter or use a local tool.
When should I use the homepage text diff instead?
Use this page when you want a Markdown-specific URL and examples. The comparison itself is the same style of line diff. The homepage text diff also offers word and character modes, which can help when a single line of prose changed in the middle.
How do I preview the rendered Markdown?
Use the Markdown Preview page for a rendered view of a single document. This diff page will not show how the change looks after HTML conversion. If you need to compare the generated HTML itself, convert both sides and open HTML Diff.
Related tools and guides
References
- CommonMark describes how Markdown source is parsed into a document. This page does not implement that specification; it only compares the text you paste.
- GitHub Flavored Markdown and other dialects add tables and strikethrough. Those features are still just lines of text here, so a table-cell change is a line change, not a structured cell diff.
- If the document already lives in Git, a local
git diffkeeps the change with its history. A browser diff is still useful for a throwaway paste that was never committed.