How to compare two Markdown files
Markdown Compare — open the free tool →Markdown is everywhere: README files on GitHub, project documentation, changelogs, blog drafts, Obsidian notes and, more and more, text written or rewritten by AI assistants. When you get a second version of one of these files, the question is always the same — what exactly changed? Reading both files top to bottom is slow and you will miss small edits like a changed link or a removed list item.
Here is how to compare two Markdown files properly, plus the formatting habits that create "fake" differences.
Method 1: Markdown Compare in your browser
- Open Markdown Compare.
- Open the original .md file with the file picker above the left box (or drag the file onto the box, or paste the text). Do the same with the new version on the right.
- Click Compare now. Added lines are green, removed lines are red, and inside a changed line the exact words that differ are highlighted.
- Tick Only changes to hide unchanged lines in a long document, and use Previous/Next change to step through every edit.
- Use Copy report or Download to keep a copy of both versions with a summary of added, removed and unchanged lines.
The files are read in your browser and not uploaded, so it is fine for internal docs and private notes. The tool compares the raw Markdown, which is what you want when reviewing docs: a link that now points to a different URL, or an image with a new path, is a real change even if the visible text looks the same.
Method 2: VS Code or git diff
If both files are on your computer and you use VS Code, right-click the first file and choose Select for Compare, then right-click the second and choose Compare with Selected. If the docs are in a Git repository, git diff --word-diff is much better for prose than plain git diff, because it shows changed words instead of whole changed lines.
Method 3: Your notes app's history
Many note apps keep older versions. In Obsidian, the core File recovery plugin stores snapshots of your notes; open an older snapshot, copy it, and compare it with the current note in Markdown Compare. For Notion, export both versions as Markdown first.
Avoid fake differences
- Reflowed paragraphs: some editors wrap lines at 80 characters, others keep a paragraph on one line. If one version was re-wrapped, almost every line differs. Keep the same wrapping style, or better, write one sentence per line.
- Blank lines: extra empty lines between sections do not change the rendered page. Tick Ignore blank lines.
- Trailing spaces: two spaces at the end of a line create a line break in Markdown and are easy to add by accident. Ignore whitespace hides them — but remember they can matter for how the page renders.
- List markers and emphasis:
*and-lists, or*text*and_text_, render the same but are different characters. A formatter like Prettier makes them consistent; run it on both versions before comparing. - Tables: a formatter that re-aligns table pipes changes every row of the table. Format both files the same way first.
Where this is useful
- AI-edited docs: you asked an assistant to "improve" a README — compare before and after to see every sentence it changed or deleted.
- Contributor edits: someone sends an updated doc by email or chat instead of a pull request.
- Blog drafts: compare the draft your editor returned with what you sent.
- Release notes: check what was added to CHANGELOG.md between two releases.
Comparing something other than Markdown?
For plain prose use Text Compare, for .docx files use Word Compare, and for HTML exported from a Markdown site use HTML Compare, which can format the markup before comparing.
Markdown Compare — open the free tool →Frequently asked questions
Can I compare two .md files without Git?
Yes. Open Markdown Compare, open or drag a .md file onto each box (or paste the text) and click Compare now. No repository or account is needed.
Does the tool compare the rendered page or the Markdown source?
The source. You see changes to headings, links, image paths, list markers and code fences exactly as written. To compare only the visible text, copy it from the rendered preview into Text Compare.
Why does a whole paragraph show as changed when I edited one word?
In Markdown a paragraph is often one long line, so the line counts as changed. The tool still highlights the changed words inside it. For long documents, writing one sentence per line gives much cleaner diffs.
Are my files uploaded?
No. On CompareOnline4U the files are read and compared in your browser, not sent to a server.
Can I compare Obsidian or Notion notes?
Yes, as long as you have them as Markdown text. Export the Notion page as Markdown, or open the note's .md file from your Obsidian vault, and compare the two versions.