Developer and Text Tools

How to Find and Fix Broken Links in Markdown Documentation

Check a docs folder for broken relative links, missing heading anchors, wrong letter case and missing images before you publish, and fix them in one pass.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
How to Find and Fix Broken Links in Markdown Documentation

Documentation is rarely broken by one big mistake. It is broken by many small, reasonable changes: a file renamed during a cleanup, a heading reworded for clarity, an image folder reorganised. Each change leaves a few links pointing at something that no longer exists, and readers only notice when they click. This guide explains the kinds of broken links that appear in Markdown, why some only fail after deployment, and how to catch them with the free Markdown Link Checker.

Missing files. A relative link such as guides/install.md points to a path that does not exist. This happens after moves and renames.

Missing anchors. The link reaches the right file but the part after the hash sign does not match any heading. Readers land at the top of a long page instead of the section they wanted. Anchors are generated from the heading text, so changing Requirements to System requirements silently breaks every link to #requirements.

Wrong letter case. Windows and macOS treat Install.md and install.md as the same file, so the link works on the author's laptop. Linux servers and Git do not, so it breaks on the published site.

Broken references. Markdown allows a link written as text followed by an identifier in square brackets, with the address defined elsewhere in the file. If the definition is missing, the link is shown as plain text with brackets.

How anchors are made

Each platform turns heading text into an anchor in its own way. GitHub lowercases the text, removes punctuation except hyphens and underscores, and turns every space into a hyphen, so a heading containing an ampersand between two spaces produces two hyphens in a row. Repeated headings get -1, -2 appended. GitLab merges repeated hyphens. Bitbucket adds a prefix. Many static site generators produce plain ASCII slugs. A checker must use the same rules as the place where your readers read the docs, which is why the anchor style is an option.

Step by step

  1. Press Open a folder and choose the root of the repository or docs folder, or drop a ZIP. Opening the root matters: links to files outside the opened folder are reported as missing.
  2. Choose the anchor style that matches where the documentation is read.
  3. Read the summary: number of files, links, problems, external links and duplicate headings.
  4. Go through the problem table. Each row shows file and line, the link, the status and a note. Where the right answer is clear, a suggested fix is offered: the correctly cased path, the only file in the folder with that name, or the closest existing anchor.
  5. Apply single fixes or all suggestions at once. Every fix can be undone.
  6. Download the corrected files as a ZIP and the CSV report for your issue tracker.

Links to other websites are listed but not fetched. Browsers do not allow a page to read other sites unless those sites permit it, so an honest browser tool cannot test them. Export the CSV and check external links with a server-side tool or a scheduled job in your build pipeline.

Duplicate headings

The checker also lists headings that appear more than once in the same file. They are not errors, but links to the second copy need a suffix that authors rarely guess correctly. Renaming duplicates, for example Examples for install and Examples for configuration, makes the anchors predictable.

Making it a habit

Run the check before every release of the docs, and after any reorganisation of folders. When you rename a heading that other pages link to, search for the old anchor first. Prefer lowercase file names with hyphens, which avoids the case problem completely. These small rules keep a large documentation set navigable for years.

Privacy

The files are read into the browser tab and never uploaded, so private repositories and internal handbooks are safe to check.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages