Markdown Diff: Compare Two .md Files

Paste or open two versions of a Markdown file to see every change, with the changed words highlighted. Switch to Rendered to compare the formatted documents. Runs in your browser; nothing is uploaded.

Example · README.md · 29 lines

+6 −5 · 4 changes

11# Acme CLI
22​
3Removed: A small command-line tool for syncing notes between folders.
3Added: A fast command-line tool for syncing Markdown notes between folders.
44​
55## Install
66​
77```bash
8Removed: npm install -g acme-cli
8Added: pnpm add -g acme-cli
99```
1010​
1111## Usage
1212​
1313Run `acme sync <from> <to>` to copy new and changed notes.
1414​
1515- Skips hidden files
16Removed: - Keeps file dates
17Removed: - Works on macOS and Linux
16Added: - Keeps file dates and permissions
17Added: - Works on macOS, Linux and Windows
18Added: - Watches for changes with `--watch`
1819​
1920## Options
2021​
2122| Flag | Default | Description |
2223| --- | --- | --- |
2324| `--dry-run` | off | Show what would change |
24Removed: | `--delete` | off | Remove files missing from the source |
25Added: | `--watch` | off | Keep running and sync on every change |
2526​
2627## License
2728​
2829MIT

Source diff or rendered diff

A source diff compares the Markdown text line by line, the way git diff and GitHub's pull request view do. It shows everything, including changes that don't affect the output, such as a * list marker turned into a -.

The rendered diff compares what the reader sees. Both versions are rendered, then matched paragraph by paragraph, list item by list item and table row by table row. Edited words are marked inside the text, and whole blocks that were added or removed are shaded. If the source changed but the rendered view shows no marks, the change was formatting only.

How to use Markdown Diff

  1. Paste the original Markdown on the left (Original) and the new version on the right (Changed), or open or drop the .md files. Drop two files at once to fill both sides.
  2. Read the changes: removed lines are red, added lines are green, and the changed words inside them are highlighted darker.
  3. Switch between Split, Unified and Rendered, or tick Ignore whitespace.
  4. Copy the patch, download it as a .diff file, or copy a share link.

Why use tinyMD for Markdown Diff

  • The diff updates as you type or paste; no Compare button
  • Split (side by side) and unified views, with the changed words highlighted inside each changed line
  • Rendered view: the formatted document with removed and added words, list items, table rows and code marked in place
  • Ignore whitespace, swap sides, and jump between changes; long unchanged stretches fold away
  • Paste, open, or drop .md files; drop two files at once to fill both sides
  • Copy or download the changes as a unified .diff patch that git apply and patch -p1 accept
  • Share link: both texts are stored in the link itself, not on a server
  • Runs in your browser: neither file is uploaded

Frequently asked questions

How do I compare two Markdown files online?

Paste or open the original version on the left and the changed version on the right. The differences appear straight away: removed lines in red, added lines in green, with the changed words highlighted. You can also drop two .md files on either box to load both at once.

Does it highlight changes within a line?

Yes. When a line was edited rather than replaced, only the words that changed are highlighted inside it, in both the split and unified views. Lines with almost nothing in common are shown as a plain removal and addition.

Can I compare the rendered Markdown instead of the source?

Yes. Choose Rendered to see the formatted document with removed text struck through in red and added text in green. Paragraphs, headings, list items, table rows and code blocks are compared individually, so one edited list item doesn't mark the whole list.

How do I ignore whitespace and line ending changes?

Tick Ignore whitespace to treat lines that differ only in spaces or tabs as unchanged. Windows (CRLF) and Unix (LF) line endings are always treated as the same.

Can I export the diff as a patch?

Yes. Copy patch or the .diff button gives you a unified diff with three lines of context, the same format as git diff. You can apply it with git apply or patch -p1. The patch always compares exactly, even if Ignore whitespace is ticked.

Are my files uploaded to a server?

No. The comparison runs in JavaScript in your browser. The share link also doesn't upload anything: both texts are encoded into the link, so very large files can't be shared that way.

Can I compare large Markdown files?

Yes. Files of a few thousand lines compare quickly, and unchanged stretches fold away so only the changes and three lines around them are shown. Click a fold to expand it.

Does it handle front matter, tables and code blocks?

Yes. In the source views they are compared like any other lines. In the rendered view, table rows and code blocks are compared individually; YAML front matter is not part of the rendered output, so changes to it show only in the source views.