How to Count Words in a Markdown File Correctly
Run a Markdown file through a generic word counter and you'll get a number that's technically true but practically misleading — it's counting #, **, and [ characters as if they were part of your writing, when they're just formatting instructions.
Why this matters
If you're working against a word count target — an assignment, a contract deliverable, a content brief — a count that's padded by formatting symbols can make a piece look longer than it actually is. A document with a lot of headings and links will show a noticeably inflated count from a naive tool.
What an accurate count actually does
It strips the Markdown formatting first — heading hashes, bold/italic asterisks, list markers, blockquote arrows — and counts words in what's left, which is the same text a reader would actually read. A heading like # Getting Started counts as two words ("Getting" and "Started"), not four tokens including the hash and space.
What about link text and code blocks?
Link text is real content and should count — "click here" is two words whether it's a link or not. The URL itself isn't counted, since nobody reads a URL as prose. Code block contents are counted too, on the reasoning that if you wrote it, it's part of the document.
Try it on your own file
The Markdown Word Counter on this site does exactly this — strips formatting first, then counts, and also reports characters, sentences, paragraphs, and an estimated reading time.
A quick manual sanity check
If you're ever unsure whether a tool is counting correctly, convert your file to plain TXT first and count that instead — since the formatting is already gone, any standard word counter will now give you the same accurate number.
Frequently asked questions
- Does this word counter count table cell content?
- Yes, text inside table cells is included in the count; only the pipe and dash characters that build the table structure are excluded.
How this guide was prepared: The counting method described matches exactly what this site's word counter tool does internally.