DevTools Logo

Markdown Linter

Markdown Linter

Check Markdown for common style issues — headings, whitespace, tabs, and more — in your browser

Markdown

Paste or type Markdown to lint

    Examples

    Heading level jump

    Input
    # Title
    ### Skipped a level
    
    Some content here.
    
    Output
    L2  MD001  Heading level jumps from h1 to h3

    MD001 catches heading increments that skip a level (H1 → H3). It only fires inside the body of the document, never on the first heading.

    Multiple consecutive blank lines

    Input
    # Title
    
    Paragraph here.
    
    
    
    Next paragraph after extra blanks.
    
    Output
    L5  MD012  Multiple consecutive blank lines

    MD012 reports the second of any two adjacent blank lines, which is the line you can delete to collapse the gap to one.

    Trailing whitespace and a hard tab together

    Input
    # Heading   
    	indented with a tab
    
    Output
    L1  MD009  Trailing whitespace
    L2  MD010  Hard tab found — use spaces

    MD009 and MD010 run independently, so a single line can produce both — trailing spaces plus a tab character. Content inside fenced code blocks is ignored, so a literal tab in a code sample is fine.

    About this tool

    Markdown is forgiving, which is exactly why inconsistencies creep in: headings that jump levels, hard tabs mixed with spaces, lines that wrap at odd widths, and stray trailing whitespace. markdownlint codifies the community conventions that keep documents clean and render predictably across tools.

    This linter runs a focused subset of those rules — MD001 (heading increment), MD009 (trailing whitespace), MD010 (hard tabs), MD012 (multiple blank lines), MD013 (line length), MD018 (space after #) and MD026 (trailing punctuation in headings) — and reports each issue with its line number, the rule id, and a plain-English explanation. Code blocks are skipped, so nothing inside a fenced block is flagged.

    Linting runs entirely in your browser. Your document is never uploaded, so it's safe to lint README files, documentation, or draft posts in place.

    How to use

    1. Paste your Markdown

      Enter or paste the document into the input pane.

    2. Review the findings

      Each issue shows its line number, rule id, and a short explanation; code blocks are ignored.

    3. Fix and re-check

      Correct the flagged lines and watch the issue list update live.

    Use cases

    Pre-commit check on a documentation repo

    Run the linter over a README or docs folder before opening a PR; copy the rule ids (MD001, MD009…) into a CI markdownlint config to enforce the same rules automatically.

    Cleaning up a legacy Markdown corpus

    Paste a long document and use the per-line findings to bulk-replace hard tabs with spaces and collapse triple blank lines — the rules match the same findings markdownlint itself reports.

    Teaching Markdown style

    Show trainees a deliberately messy snippet and the issue list that comes back; each rule id maps to a single rule on markdownlint's docs.

    Validating a blog post draft

    Paste the post, fix the flagged lines, and confirm the issue list is empty before publishing. Lint runs locally so drafts never leave the browser.

    Checked rules

    RuleWhat it catches
    MD001Heading levels that skip (e.g. H1 → H3)
    MD009 / MD010Trailing whitespace and hard tabs
    MD012Multiple consecutive blank lines
    MD013Lines longer than the configured width
    MD018 / MD026Missing space after # and trailing heading punctuation

    Content inside fenced code blocks is skipped.

    Common mistakes

    Mistake:Treating warnings as fatal and rewriting readable prose.

    Fix:MD013 (line length) and MD026 (trailing punctuation) are stylistic. Disable the rules you don't care about in your own pipeline rather than mass-editing the prose.

    Mistake:Expecting HTML mistakes to be flagged.

    Fix:This linter targets Markdown style only. For HTML inside Markdown, use an HTML validator or rely on the Markdown renderer's own diagnostics.

    Mistake:Pasting a document and assuming the first heading is checked by MD001.

    Fix:MD001 only fires on transitions, not on the document's first heading — there is no previous level to compare against. That matches the upstream markdownlint behaviour.

    Mistake:Hard-coding four spaces in nested lists.

    Fix:Lists are outside the linter's scope here. Configure your Markdown renderer and your editor (or a full markdownlint config) for the indentation depth you want.

    Frequently asked questions

    References & standards