Markdown Word Counter
Paste or import a Markdown file and get an honest word count — code blocks, inline code and link URLs are stripped before anything is counted.
How do you count words in a Markdown file?
Use a word counter that understands Markdown rather than plain text. An accurate count removes fenced code blocks, inline code, image syntax and link URLs before counting, so only prose is measured. Most counters then divide that total by 225 words per minute to estimate reading time.
pandoc -t plain README.md | wc -wPandoc converts the Markdown to plain text and wc counts the words in that output — far closer to the real figure than running wc -w on the raw .md file.
Try the Markdown Word Counter
Statistics
Markdown Input
Preview
Markdown Word Counter & Reading Time Estimator
Welcome to MDUtil's Markdown Word Counter tool. This tool helps you:
- Count the total number of words in your Markdown text
- Calculate the estimated reading time
- Track character count, line count, and paragraph statistics
- All while ignoring code blocks and markup syntax
How It Works
This tool intelligently analyzes your Markdown content, stripping away syntax elements to focus on the actual readable text. The reading time estimate is based on an average reading speed of 225 words per minute.
Example Content
This is some example content to demonstrate the word counter and reading time estimator. Feel free to replace this with your own Markdown content to see accurate metrics for your text.
Code Example (not counted in statistics)
// This code is excluded from word count calculations
function helloWorld() {
console.log("Hello, world!");
}
Tips for Writers
- Aim for around 1,500-2,500 words for blog posts
- A 5-minute read (around 1,100-1,200 words) is ideal for online articles
- Break up long paragraphs for better readability
- Use headers to structure your content
The best writing is rewriting. – E.B. White
What a Markdown word count should and should not include
Running a generic word counter over a .md file inflates the result, because every fence line, heading hash and URL is treated as a word. These are the cases that separate a raw character count from a usable one.
Fenced code blocks and inline code
Code is not prose. Everything between triple backticks is removed before counting, and so is anything wrapped in single backticks. This is the single biggest source of inflated counts in technical writing.
Install the CLI with `npm i -g mdutil`, then run:
```bash
mdutil count README.md --json
```Counts 7 words — the sentence only. The command inside the backticks and the entire fenced block are excluded.
Links, images and bare URLs
A link contributes its visible text, never its target. Long tracking URLs would otherwise add a dozen phantom words each, and images contribute nothing a reader actually reads.
See the [migration guide](https://example.com/docs/v2/migration?utm_source=blog) for details.Counts 6 words: See, the, migration, guide, for, details. The URL and its query string are discarded.
Headings, lists and blockquote markers
Structural characters are markup, not vocabulary. Heading hashes, list bullets, table pipes and blockquote arrows are syntax and never count toward the total, though the text they introduce does.
## Release notes
- Faster startup
- Fewer allocations
> Ships Friday.Counts 7 words: Release, notes, Faster, startup, Fewer, allocations, Ships, Friday. The ##, - and > characters are ignored.
Raw HTML in Markdown
Markdown lets you drop HTML straight into a document. Tags are stripped and their text content is kept, so a badge table or a details block does not distort the number.
<details>
<summary>Advanced options</summary>
These flags are experimental.
</details>Counts 5 words: Advanced, options, These, flags, are, experimental — the tags themselves contribute nothing.
YAML front matter is still counted
This is the one gotcha worth remembering. Front matter looks like metadata to you, but to a counter it is ordinary text at the top of the file. Delete it before measuring if you want a body-only figure.
---
title: Shipping faster with fewer meetings
date: 2026-07-24
tags: [process, remote]
---
The first real paragraph starts here.Adds roughly ten words from the metadata block on top of the body count. Remove the front matter for an accurate article length.
Reading time from the word count
Reading time is word count divided by a reading speed. This tool uses 225 words per minute, the middle of the 200–250 range typically measured for adult readers of English prose. Divide by 150 instead for dense technical material.
reading_time_minutes = word_count / 2251,125 words is a 5 minute read at 225 wpm, or roughly 7 minutes 30 seconds at the slower 150 wpm technical rate.
How other tools count Markdown words
Most editors count the raw file, which is why the same document reports a different length in every app. Here is what to expect before you trust a number.
| Platform | Support | Notes |
|---|---|---|
| MDUtil (this page) | Prose only | Strips code blocks, inline code, link URLs and HTML tags, then counts what is left. |
| VS Code | Raw text | The Markdown word count in the status bar includes fence lines, heading hashes and URLs. |
| Obsidian | Raw note | The built-in counter reads the whole note, so YAML front matter and code blocks are in the total. |
| GitHub / GitLab | Not available | Neither web UI shows a word count for READMEs, issues or PR descriptions. |
| Notion | Rendered text | Counts the converted blocks, so pasted Markdown syntax disappears from the total. |
| Word / Google Docs | Raw text | Pasting Markdown counts asterisks, hashes and full URLs as words, inflating the result. |
| Medium / Substack | Reading time only | Both publish an estimated read time from the rendered article instead of a word count. |
How to count words in Markdown
Add your Markdown
Type or paste into the editor, or use the import button to load an existing .md, .markdown or .txt file from your computer.
Read the statistics bar
Words, reading time, characters, lines and paragraphs update on every keystroke at the top of the tool.
Check the preview
Compare the rendered preview with the editor to confirm that the blocks you expected to be excluded — code fences especially — really are code.
Export the numbers
Use Export Metrics to download a JSON file containing every statistic plus a timestamp, handy for tracking article length over time.
Frequently Asked Questions
How do I count the words in a Markdown file?
Paste the file into a counter that parses Markdown instead of treating it as plain text. On this page the count updates as you type. From a terminal, pandoc -t plain README.md | wc -w gives a comparable figure by converting to plain text first.
Does the word count include Markdown syntax?
No. Heading hashes, list bullets, table pipes, blockquote markers, emphasis asterisks and HTML tags are all removed before counting. Only the text a reader actually reads is measured.
Are code blocks counted as words?
No. Fenced code blocks and inline code spans are stripped first, so a documentation page with long examples reports its real prose length rather than a number dominated by source code.
How is the reading time calculated?
Reading time is the word count divided by 225 words per minute, the middle of the 200 to 250 range commonly measured for adult readers. Values under a minute are shown in seconds.
How many words is a 5 minute read?
About 1,125 words at 225 words per minute. Most publishers treat 1,000 to 1,300 words as the sweet spot for a five minute article, which is why that length is so common for blog posts.
Why does VS Code show a different word count for the same file?
The VS Code status bar counts the raw file, so every fence line, heading hash and URL is treated as a word. On a technical article the difference between that number and a prose-only count can exceed thirty percent.
Does YAML front matter count toward the total?
Yes. Front matter is plain text as far as a counter is concerned, so a metadata block adds roughly ten words. Delete it before measuring if you need the body length on its own.
Does the counter work for Chinese, Japanese or Korean text?
The word count splits on whitespace, which is unreliable for languages that do not separate words with spaces. For CJK content read the character count instead — it is the figure editors and publishers use for those languages anyway.
Is my Markdown uploaded to a server?
No. The whole calculation runs in your browser with JavaScript. Nothing is uploaded, stored or logged, so the tool is safe for unpublished drafts and internal documents.
What is the difference between character count and word count here?
Both are measured on the same cleaned text, after code blocks and URLs have been removed. The character count includes spaces and punctuation, which makes it the more reliable metric for non-English content.