VS Code Markdown Word CountA Visual Studio Code extension that shows word and character counts for Markdown files, with per-field breakdowns for YAML frontmatter. FeaturesStatus bar Word CountWhen a Markdown file is active, the current word count appears in the status bar:
The count updates live as you type and excludes Markdown syntax — heading markers, bold/italic markers, code blocks, inline code, images, HTML tags, and list markers are all stripped before counting, so only prose words are counted. Selection Word CountWhen you select text, the status bar shows both the full document word count and the selection word count:
The selection count updates as you adjust the selection and disappears when the selection is cleared. Multiple non-contiguous selections (multi-cursor) are counted together. The hover tooltip also gains a Markdown Editor and Custom Editor SupportThe word count also works when a Markdown file is open in a custom editor rather than the standard text editor, including:
Counts update live as you type in editors that are backed by a VS Code text document, which includes the built-in Markdown Editor. Editors that keep their own copy of the file update when the file is saved to disk. Custom editors render inside a webview and don't share their selection with other extensions, so the selection word count is only available in the standard text editor. Word Count TargetsYou can set a minimum and/or maximum word count target. When a limit is configured, the status bar text changes color to indicate whether you are within your target:
When both a minimum and maximum are set, a directional arrow also appears after the count:
All three colors are fully configurable to match your theme. See Extension Settings below. Per-Document Limits via FrontmatterYou can also set word count limits on a per-document basis by adding
Frontmatter limits take priority over the workspace settings for that file. This is useful when different documents in the same workspace have different length targets. Hover Tooltip with DetailsHovering over the status bar item shows a detailed breakdown:
Show Details CommandRun Markdown Word Count: Show Details from the Command Palette ( Frontmatter SupportThe extension parses YAML frontmatter delimited by Multi-line scalar values and quoted strings are handled correctly. Array and object fields are parsed as keys but their word counts will reflect the raw YAML, not nested structure. You can also limit the body range that contributes to the main word count by defining
If these metadata tags are not defined, the extension counts the whole Markdown body as usual. If only If a marker is defined but its value does not appear in the document body, the marker is silently ignored and counting proceeds as if it were not set (i.e. the whole document, or the range defined by the other marker, is counted). If Note: Note: selection word counts are not affected by RequirementsVS Code 1.146.0 or newer. Extension Settings
Color settings accept hex color values (e.g. Known Issues
Release NotesSee CHANGELOG.md for the full release history. |