Markdown Word Counter
Markdown Word Counter turns a Markdown file into real numbers: words, characters, characters without spaces, reading time, lines, paragraphs, headings, links, images and fenced code blocks. The Markdown is converted to plain text first, so formatting syntax does not inflate the count. Paste, press Count, and read the stats or the raw JSON.
Gunakan Markdown Word Counter
Raw JSON
{}
Baca Isi
What this counter measures
Paste a Markdown document and this tool reports twelve numbers about it: words, characters, characters without spaces, estimated reading time, lines, paragraphs, headings, links, images, fenced code blocks, and a word-density figure, with the raw JSON response shown underneath. It is built for people who write in Markdown and want a quick structural read before publishing a README, a docs page, a changelog or a blog post.
The count is not a textarea length check. The Markdown is converted to HTML with a GitHub-flavoured Markdown parser, the HTML is stripped back to plain text, and the statistics are calculated on that plain text. That is why the syntax characters you typed do not inflate the character count.
How the count is produced
- The Markdown is normalised to Unix line endings.
- YAML front matter is removed if the document starts with it, so a title block at the top of a post does not count as body text.
- The document is rendered with a GFM converter that strips raw HTML rather than executing it.
- Tags are removed, HTML entities are decoded, runs of spaces and tabs are collapsed, and excess blank lines are trimmed.
- Words are counted as whitespace-separated tokens in the resulting text; characters, lines and paragraphs are measured from the same text.
- Headings, links, images and code fences are counted separately by scanning the raw Markdown, skipping anything inside fenced code.
Count does not run automatically. The small “possible words” figure under the editor is a rough live estimate based on splitting your raw Markdown on whitespace, so it includes syntax tokens. The real figures appear only after you press Count.
The stat cards, explained
Words
Every whitespace-separated token in the plain text counts as a word. Normal prose behaves as you expect. Code and formulas do not: in a fenced block, const x = 1; contributes four tokens, because const, x, = and 1; are each separated by spaces. That is the honest behaviour of a whitespace tokenizer, and it is why a code-heavy README can show more words than its prose suggests.
Characters and characters without spaces
Characters are the length of the plain text, including spaces and line breaks but excluding Markdown syntax, link URLs and image markup. Characters without spaces removes every whitespace character. For a publisher with a hard character budget, the no-spaces figure is the stricter one.
Lines and paragraphs
Lines are counted from the plain text, not from your source file, so a paragraph you wrapped across five source lines reads as one line after conversion. Paragraphs are blocks separated by a blank line, measured on the same converted text.
Headings
Only ATX headings are counted: a line starting with one to six # characters followed by a space. Setext headings, written with a line of === or --- underneath, are not included. Headings inside fenced code blocks are ignored, so a shell comment starting with # inside a fence is not mistaken for a heading.
Links and images
Links are matched from [text](url) patterns and from bare http or https URLs found outside code fences. Images are matched from  patterns outside fences. Reference-style links, defined with [id]: url at the bottom of a file, are not resolved by this scanner.
Code blocks
Each fenced block counts when an opening fence of three or more backticks or tildes is found. Only one number per block is reported; the language tag is not shown and the block's contents are not analysed separately. An unclosed fence still counts as one block.
Reading time
Reading time is the word count divided by 200 words per minute, rounded up, with a floor of one minute. It is a rough estimate for average prose. Dense technical text, tables and code take longer per word, so treat the figure as a lower bound rather than a promise.
Word density
This card is calculated in your browser, not by the server. It divides the word count by the character count and caps the result at 100 percent, so it reflects how long the average word is, not keyword density. A document full of short words scores higher than one with long technical terms. It is not a readability score and not an SEO keyword ratio.
What counts and what does not
| Element | Counted in words? | Notes |
|---|---|---|
| Paragraph text | Yes | Normal prose, including bold and italic content |
| Heading text | Yes | Heading markers themselves are not counted |
| Link text | Yes | The URL is excluded from the text |
| Bare URL | Yes | A URL written on its own becomes one token |
| Image alt text | No | The image markup is stripped entirely |
| Code fence contents | Yes | Counted as whitespace-separated tokens |
| YAML front matter | No | Removed before conversion |
| Markdown syntax | No | Hashes, asterisks, backticks and brackets are stripped |
| Raw HTML tags | No | HTML input is stripped by the converter |
How to use it
- Open the tool. The editor is focused on Markdown and starts empty.
- Paste with the Paste button, or type into the editor. The footer shows the raw input length and the rough possible-word estimate.
- Press Count. The button shows a spinner while the request runs.
- Read the cards. The raw JSON panel below them shows the exact response, and its badge reports how large that JSON is.
- Edit and count again after changes. The cards keep the previous result until the next successful count, so a stale number is possible if you forget to re-run.
- Use the trash icon to clear the editor and reset every card.
Why count Markdown rather than plain text
A word processor counts what it displays, and a Markdown file displays syntax. If you paste raw Markdown into a generic counter, every **bold** marker, heading hash and link target is treated as text, which inflates characters and can distort words. Converting first gives you a figure that matches what a reader will actually see on the rendered page. The trade-off is that the tool must know which Markdown flavour you mean, and it assumes GitHub-flavoured Markdown with tables, strikethrough and task lists.
Accuracy, quirks and limits
A few behaviours are worth knowing before you quote a number. The link counter can over-report: a Markdown link containing an absolute URL is matched once by the bracket pattern and again by the bare-URL scan, and image URLs are picked up by the URL scan as well. A document with many absolute links can therefore show nearly twice as many links as it visually contains. The heading counter ignores setext style. The word counter treats symbols as words when they stand alone. Lines reflect converted text, not editor rows.
Input is capped at 200,000 characters. The request is rejected above that limit rather than silently cut. The tool does not count pages, does not detect language, does not score readability, and does not check spelling or links; it is a counter, not a linter. For a link check, use a dedicated validator.
Privacy
Counting happens on the server: the Markdown you submit is sent in a request and returned as a JSON response. Do not paste unpublished drafts under embargo, private keys, customer data or anything else you would not put in a form submission. The tool does not create an account, does not keep a document history, and does not return your text in the response, only the derived numbers and their JSON.
Common mistakes
- Reading the live estimate as the result. It splits raw Markdown on whitespace; press Count for the real figures.
- Comparing the word count to a Word document. Word counts vary by tokenizer; code blocks and symbols are the usual source of difference.
- Thinking word density is a keyword ratio. It is words divided by characters.
- Expecting image alt text in the count. It is stripped with the image markup.
- Assuming every heading is counted. Underlined setext headings are not.
- Editing after counting. The cards do not update themselves.
Frequently Asked Questions
Pertanyaan yang Sering Diajukan
Komentar (0)
Jelaskan masalah yang Anda alami agar kami dapat menyelidikinya dan meningkatkan alat ini.