Last updated
Markdown Validator Examples
The Markdown Validator checks your documents for syntax errors, structural issues, and common problems that cause unexpected rendering. Below are examples of issues detected and their fixes.
Valid Markdown — No Issues
# Project Documentation
## Installation
Install the package:
```bash
npm install my-package
```
## Usage
| Option | Type | Default |
|--------|--------|---------|
| debug | boolean | false |
| port | number | 3000 |
See [API Reference](#api-reference) for details.
## API Reference
...content...
Validator result: No issues found. Document structure is valid.
Unclosed Code Fence
## Example
Here is some code:
```javascript
function hello() {
console.log("Hello");
// Missing closing ``` — everything below renders as code
## Next Section
This text will render as code, not a heading.
Validator output:
Error — Line 5: Unclosed fenced code block.
Opening fence "```javascript" at line 5 has no matching closing fence.
All content after line 5 will render as code.
Fix: Add closing ``` after line 7.
Heading Hierarchy Skip
# Introduction
### Installation ← skipped H2
#### Step 1 ← skipped H2 and H3
Validator output:
Warning — Line 2: Heading level skipped.
H1 followed by H3 — H2 is missing.
This creates accessibility issues and breaks document structure.
Fix: Change "### Installation" to "## Installation".
Warning — Line 3: Heading level skipped.
H3 followed by H4 without H2 context.
Fix: Add H2 before H3, or change H4 to H3.
Malformed Table
| Name | Role | Status |
|-------|--------|
| Alice | Admin | Active |
| Bob | Editor |
Validator output:
Error — Line 2: Table separator row has 2 columns, header has 3.
The separator row must have the same number of columns as the header.
Fix: Change "|-------|--------|" to "|-------|--------|--------|"
Error — Line 4: Row has 2 columns, expected 3.
Missing value for column "Status" in row 3.
Fix: Add the missing column value or use an empty cell: "| Bob | Editor | |"
Broken Internal Link
See [Installation Guide](#instalation) for setup instructions.
## Installation
...content...
Validator output:
Warning — Line 1: Broken anchor link "#instalation".
No heading with anchor "instalation" found in this document.
Available anchors: #installation, #usage, #api-reference
Did you mean: #installation?
Image Missing Alt Text

 ← OK
Validator output:
Warning — Line 1: Image missing alt text.
Images should have descriptive alt text for accessibility.
Fix: Add alt text: ""
Inconsistent List Markers
- Item one
* Item two ← different marker
- Item three
Validator output:
Warning — Line 2: Inconsistent list marker.
List uses "-" but item on line 2 uses "*".
Fix: Use consistent markers throughout the list.
Trailing Whitespace
Line with trailing spaces
Next line
Validator output:
Info — Line 1: Trailing whitespace detected.
Note: Two trailing spaces create a line break in Markdown.
If intentional, this is valid. If not, remove the trailing spaces.
Common Issues Summary
- Unclosed code fences — causes rest of document to render as code
- Heading hierarchy skips — accessibility and structure issues
- Inconsistent table column counts — table renders as plain text
- Broken anchor links — navigation links go nowhere
- Missing image alt text — accessibility violation
- Inconsistent list markers — style inconsistency
- Malformed link syntax — renders as plain text instead of link
Common Use Cases
- Validating README files before committing to GitHub
- Checking documentation for broken links and structure issues
- Running as a pre-commit hook to enforce Markdown quality
- Auditing documentation for accessibility issues
- Catching formatting errors in programmatically generated Markdown
Paste your Markdown to get an instant validation report with line numbers and suggested fixes for every issue found.