Markdown Best Practices: Writing Markdown Well (2026)

Most Markdown tutorials teach the syntax in fifteen minutes and call it done. This guide covers the harder part: writing Markdown that reads well in plain text, parses to clean semantic HTML, and survives the trip through every major renderer. ATX versus Setext headings, heading hierarchy rules, paragraph and line-break semantics, emphasis discipline, list types, fenced versus indented code, nested blockquotes, inline versus reference links, image syntax, GFM tables, and the raw HTML escape hatch — each rule grounded in what the parser actually does, not what the cheat sheet implies.

NoCostTools Editorial Team· Updated October 22, 2026· 29 min read
Markdown source text rendered as clean headings, lists, code blocks, and a reference-link block

The Markdown Philosophy: Readable Source, Structured Output

Markdown's defining property is not that it renders to HTML — plenty of formats do that. It is that the raw source is meant to be read directly by humans. John Gruber's original 2004 spec called Markdown "an email-style convention for writing richly-formatted text," and that framing is what separates it from every markup language that came before. The syntax should look correct in a plain-text editor before any rendering happens. That is why pound signs denote headings, why asterisks denote emphasis, why indented blocks denote code — each glyph already reads as something even before a parser sees it.

The practical consequence is a rule most authors learn the hard way: write syntax that reads well in plain text and parses to clean semantic HTML. When you optimize only for output, you produce HTML dressed up in minimal sigils — paragraphs full of inline raw HTML, attribute tricks, and parser-specific extensions that no plain-text reader can follow. When you optimize only for source, you produce clever shorthand that some renderers ignore or mangle. The best practice is to satisfy both audiences with one source file.

That dual obligation drives every convention in this guide. ATX headings beat Setext underlining because the source is shorter and easier to scan. Asterisks beat underscores for emphasis because they survive mid-word insertion. Fenced code blocks beat indented ones because they can carry a language hint without breaking the source. Reference links beat inline links for long reference docs because the prose stays readable when the same URL is reused. The platform-specific stuff — exactly which extensions a given renderer supports — is the territory of our markdown platforms guide and the GitHub-specific behaviors in the GitHub markdown guide; this article stays on the writing rules that travel.

One-sentence test: open the .md file in a plain-text editor with no rendering and ask whether the document still makes sense. If it does, you are writing Markdown. If it does not, you are writing HTML in a thin disguise.

ATX (#) Headings Beat Setext Underlining

Two heading syntaxes are valid in the original Markdown spec, and only one of them belongs in modern source files. ATX style uses one to six pound signs at the start of the line: # H1, ## H2, through ###### H6. Setext style underlines the heading text with a row of equals signs for H1 or dashes for H2:

/* ATX headings (recommended) */
# Project Name
## Installation
### Prerequisites

/* Setext headings (legacy) */
Project Name
===========

Installation
-----------

ATX wins for three concrete reasons. First, it supports all six heading levels — Setext only expresses H1 and H2, which forces you to mix styles the moment you need a sub-subsection, and mixed styles are exactly what linters flag. Second, the heading is a single self-contained line, which makes moving, deleting, copying, and grepping headings trivial. Setext headings are two-line constructs where one half is meaningless without the other, and copy-paste frequently loses the underline. Third, every modern parser and every popular linter defaults to ATX; choosing Setext means opting into a constant stream of lint exceptions and conversion requests.

Closing hashes: optional, but be consistent

ATX also allows an optional closing run of hashes (## Heading ##). The closing markers are ignored by parsers but some teams like them for symmetry. Pick one convention — closing hashes in or closing hashes out — and enforce it with markdownlint rule MD026. Mixed conventions are noise in diffs.

The closing-hash debate is a smaller version of the larger style lesson: when two forms are equally valid, the only wrong choice is to use both. For a deeper look at the linters that catch these inconsistencies, see documentation best practices; for the platforms where these conventions actually run, the markdown platforms guide catalogs which renderers and CI services enforce what.

Heading Hierarchy: One H1, No Level Skips

Headings are the document's skeleton. They are also the single most common place where Markdown authors break the contract with their renderer and their readers. Three rules cover almost every real-world case.

Rule 1: Exactly one H1

A document has one title. In source form that title is the lone # H1; in rendered form it is the lone <h1>. Multiple H1s confuse outline generators, break in-page navigation, and dilute the SEO signal that the first H1 carries. If you need a section that feels as prominent as a title, use H2 — the visual size is a CSS decision, the semantic level is the heading tag.

Rule 2: Never skip a level

Walking from H2 directly to H4 is the most common accessibility break in hand-written Markdown. Screen readers use heading levels to build a navigation outline, and a skip from H2 to H4 reads as "two missing sections" to a user navigating by heading. Always step by one: H2 → H3 → H4. If you find yourself wanting H4 directly under H2, the right fix is usually to restructure, not to skip.

Rule 3: Don't use heading levels for visual sizing

Authors sometimes reach for an H4 because the H3 looks "too big" in their preview. The fix is not a smaller heading level — it is a CSS class on the correct semantic heading, or a different element entirely (a <section> with a styled <h3>, for instance). Using a heading level to control appearance breaks the document outline for every reader who is not you.

/* Correct: single H1, no skips, semantic sizing via CSS */
# API Reference

## Authentication
### API Keys
### OAuth 2.0

## Endpoints
### Users
### Projects

/* Wrong: skipped levels, multiple H1s */
# API Reference
## Authentication
#### API Keys          /* skipped H3 — screen reader outline breaks */
# OAuth 2.0            /* second H1 — outline now has two roots */

The discipline transfers directly to the writing tools covered in our developer tools guide: every modern editor can lint heading hierarchy on save, and every static-site generator can produce a sidebar outline from a clean hierarchy. A flat hierarchy with skipped levels is also the fastest way to break a table of contents, which is one reason the static site generators guide treats heading structure as a build input, not a styling concern.

Paragraph and Line-Break Semantics

Paragraphs and line breaks are where most Markdown newcomers get burned, because the rules are not intuitive and they vary subtly between dialects. Three behaviors cover the territory.

Blank line = new paragraph

A single blank line between two text blocks starts a new paragraph. This is the default and the rule that travels everywhere. Two blank lines, three blank lines, ten blank lines — all collapse into one paragraph break in the output. Use one blank line and let the renderer handle spacing.

Two trailing spaces + newline = hard line break

Inside a paragraph, two trailing spaces followed by a newline produce a hard line break (an HTML <br>). A single newline without trailing spaces produces a soft wrap and the two lines join into one paragraph. This is the rule that makes poetry, addresses, and song lyrics render correctly — and it is also the rule that bites the most authors, because almost every modern editor strips trailing whitespace on save.

Single newline inside a paragraph = soft wrap

CommonMark and most GFM parsers treat a single newline inside a paragraph as a soft wrap: the renderer joins the two lines with a space in the output. GitHub renders single newlines as soft wraps in comments but as hard breaks in issues and pull requests — dialect-specific behavior is why this rule is the number-one portability hazard.

/* Two paragraphs: blank line between */
First paragraph.

Second paragraph.

/* One paragraph with a soft wrap: single newline, no trailing spaces */
This is one paragraph
that wraps onto two lines in source.

/* One paragraph with a hard break: two trailing spaces + newline */
Line one.␣␣
Line two renders as a new line, not a wrapped continuation.

/* One paragraph joined as one line in output */
Soft-wrapped source lines
join into a single rendered paragraph line.

Three takeaways for maintainable source. First, prefer a blank line for paragraph breaks — it is unambiguous and survives editor whitespace stripping. Second, reserve the two-trailing-spaces trick for cases where the break is genuinely part of the content (verse, postal addresses, signature blocks). Third, never rely on a single newline to produce a visible line break — render it on at least two platforms before you trust it. The writing-time markdown editor and the conversion path in the HTML to markdown conversion guide are the fastest way to see what a renderer actually does with a given line ending.

Emphasis Discipline: Asterisks, Bold, Italic

Markdown gives you two characters for emphasis — asterisks (*) and underscores (_) — and four ways to combine them. The single best practice is to pick one character and use it everywhere, but the reason why asterisks win is worth knowing because it explains the lint rule.

Why asterisks beat underscores

Underscores only parse as emphasis at word boundaries. Asterisks parse as emphasis anywhere. The practical difference shows up the moment you try to emphasize part of a word:

/* Asterisks: mid-word emphasis works */
un*fricking*believable   -> unfrickingbelievable

/* Underscores: mid-word emphasis silently fails */
un_fricking_believable   -> un_fricking_believable (literal text)

/* Underscores only work at word boundaries */
_fricking_                -> fricking
snake_case_var            -> snake_case_var (NOT emphasized)

The mid-word failure mode of underscores is invisible until it bites. A reader sees the source and assumes the underscores will italicize; the parser sees a snake_case identifier and leaves it alone. Asterisks do not have this problem because they are not a legal character in identifiers, so the parser never has to guess whether the author meant emphasis or punctuation.

Bold versus italic versus both

Single delimiters give italic (*italic*); double delimiters give bold (**bold**); triple delimiters give bold italic (***both***). The semantic HTML is <em>, <strong>, and <strong><em> respectively. Two lint rules cover the practical guidance: avoid bolding entire sentences (when everything is bold, nothing is), and prefer code spans for technical tokens — `port` renders as <code>, which is the right semantics for variable names, file paths, and command output. Bold is for keywords, not for tokens.

/* Recommended: bold for UI terms and keywords, italic for new terms, code for tokens */
Click **Save** to commit changes. The *cache invalidation* step
flushes the `port:3000` worker pool.

/* Wrong: bold for everything, no code spans */
Click **Save** to commit changes. The **cache invalidation** step
flushes the **port:3000** worker pool.

The asterisk-or-underscore question is a smaller instance of a wider rule that recurs through this guide: when two forms are equally valid, the only wrong choice is to use both. markdownlint rule MD050 enforces a single emphasis style across a file, and the consistency it buys is what lets teams hand off documentation without reformatting every paragraph.

List Types: Unordered, Ordered, and the Lazy 1. Trick

Lists are the workhorses of Markdown — every README has at least three — and they are also where parser quirks compound fastest. Two list families, three style choices, and one numbered-list trick that most authors miss.

Unordered lists: pick one marker

Three characters start unordered list items: dash (-), asterisk (*), and plus (+). All three produce <ul><li> in the output. The only rule that matters is pick one and stick to it. Dashes are the de facto default in most style guides because they do not collide with emphasis syntax; asterisks do collide when an item begins with bold text, which is one more reason to prefer dashes. Mixing markers within a single list (or even within a single document) produces inconsistent diff output and trips lint rules.

Ordered lists: lazy versus explicit numbering

Ordered lists accept any number followed by a period. Two valid styles exist, and they have different maintenance profiles:

/* Lazy numbering: every item starts with 1. */
1. First step
1. Second step
1. Third step

/* Explicit numbering: items are numbered in source */
1. First step
2. Second step
3. Third step

Both render to the same <ol><li> output with sequential numbering. The lazy style (1. 1. 1.) is preferable for any list you will reorder or insert into, because adding an item between the first and second does not require renumbering every line below it. The explicit style (1. 2. 3.) is preferable when the numbers themselves are part of the content — a top-ten list, a sequence with cross-references like "see step 3," or a numbered figure list where the source and the output should match. Lazy numbering is the safer default because most lists eventually get reordered.

Nested lists: indentation counts

Nested list items need to line up with the parent item's content. Two indentation widths are valid in most parsers — four spaces or one tab — but consistency matters because mixing them produces broken nesting on renderers that count columns. Four spaces is the safer choice because tabs are visually ambiguous in some editors and renderers.

/* Unordered with nested ordered sub-list, four-space indent */
- Setup phase
    1. Install dependencies
    2. Configure environment
- Build phase
    1. Compile assets
    2. Run tests

One parser-specific quirk worth knowing: in some GFM renderers, a nested list needs a blank line above it before the parser recognizes the nesting. The safe habit is a blank line above any nested list, even when the renderer you test on does not require it. The platform-specific list behaviors are catalogued in the GitHub markdown guide; the writing rules in this section are the ones that travel.

Code Blocks: Fenced versus Indented

Two syntaxes produce preformatted code blocks, and the modern preference is overwhelming. Fenced code blocks use three backticks (```) or three tildes (~~~) on the lines before and after the code. Indented code blocks use four spaces (or one tab) of indentation on every line. Fenced code wins for four reasons.

  • Language hints: a fenced block can name the language right after the opening fence (```python) so the renderer can apply syntax highlighting. Indented blocks have no way to specify language.
  • Works inside lists: a fenced block inside a list item just needs to be indented to the list item's content width. Indented code inside a list collides with the list's own indentation rules and frequently breaks the list.
  • Editor friendliness: every modern editor recognizes ``` as a block boundary for indentation, commenting, and syntax-highlight toggling. Indented blocks have no such signal.
  • Survives reflow: a fenced block can contain blank lines without ambiguity. An indented block with a blank line may end at that blank line in strict parsers.
/* Fenced code block with language hint (recommended) */
```python
def greet(name):
    return f"Hello, {name}"
```

/* Indented code block (legacy, no language hint) */
    def greet(name):
        return f"Hello, {name}"

Three style choices worth enforcing. First, pick a fence character — backticks are the universal default, tildes are used by teams that need to nest code blocks inside code blocks. Second, always specify a language when the content is code; ```text or ```plaintext is a valid hint for output that should not be highlighted. Third, never indent the closing fence — it must sit at column zero (or at the list-item indent when nested) to close the block. The fence-character choice and the language-hint discipline are both lint-enforceable, which is why these rules survive the migration from hand-edited docs to lint-checked CI pipelines.

For inline code — the short references inside a paragraph — use single backticks (`code`). Inline code renders as <code>, which is the right semantic element for variable names, file paths, command output, and short snippets. Reserve fenced blocks for multi-line content; one-line fenced blocks are valid but visually heavier than inline code for the same result.

Blockquotes and Nested Quotes

Blockquotes are the markdown echo of email quotations: a line prefixed with > becomes a <blockquote> in the output. The syntax is simple, but three conventions keep blockquotes readable in source and reliable in output.

One arrow per line, even for wrapped paragraphs

The cleanest blockquote prefixes every line with >, including the wrapped continuation lines. Many parsers will accept > only on the first line and treat the rest of the paragraph as quoted, but the per-line style survives editor reflow and reads correctly in plain text.

Multi-paragraph blockquotes need the arrow on the blank line too

Two paragraphs inside one blockquote need a > on the blank line between them, or the renderer closes the quote at the blank line and starts a new one.

Nested quotes: stack the arrows

Nested blockquotes — a quote inside a quote — use > > (with a space between the arrows). Most renderers indent the inner quote visually.

/* Single blockquote, one arrow per line */
> This is a quotation.
> It continues onto a second source line.

/* Multi-paragraph blockquote: arrow on the blank line */
> First paragraph of the quote.
>
> Second paragraph of the same quote.

/* Nested blockquote: stacked arrows */
> Outer quotation begins here.
>
> > Inner quotation, indented by the renderer.
> > Continues on the next line.
>
> Outer quotation resumes.

Blockquotes can contain most other Markdown elements — headings, lists, code blocks, even other blockquotes — but every line of the inner content needs its own > prefix, and the further the content is nested, the harder the source is to maintain. As a rule of thumb, if a blockquote contains more than a heading and a paragraph, refactor: pull the heading out, demote the blockquote to a callout <div>, or use a documented aside element instead. The platforms where blockquote nesting differs are catalogued in the markdown platforms guide.

Three link syntaxes cover everything, and the choice between inline and reference is a real trade-off worth understanding.

Inline links: the default

Inline links wrap the link text in square brackets and the URL in parentheses immediately after: [text](url). An optional title in double quotes after the URL renders as a tooltip: [text](url "title"). Inline links are the right choice for short, single-use URLs because the reader can see the destination without jumping to a footnote.

Reference links: the maintainable option for repeated URLs

Reference links separate the link text from the URL. The text uses [text][id], and the URL is defined elsewhere as [id]: url "title". When the same URL appears many times in a long document, reference links let you change the destination in one place and keep the prose free of long URLs that break the flow.

Autolinks: bare URLs and angle-bracket links

GFM and most modern parsers autolink bare URLs in text — https://example.com becomes a clickable link. Wrapping a URL in angle brackets (<https://example.com>) is the explicit form and works in stricter parsers that do not autolink bare URLs.

/* Inline link with title */
Read the [style guide](/docs/style "Markdown style guide").

/* Reference link: text in prose, URL defined once */
See the [style guide][style] and the [lint config][lint].

/* Reference definitions, collected at the bottom of the file */
[style]: /docs/style "Markdown style guide"
[lint]:   /docs/lint   "Lint configuration reference"

/* Autolinks */
<https://example.com>      /* angle-bracket form, portable */
https://example.com        /* bare-URL autolink, GFM-only */

Two practical rules. First, use descriptive link text: [installation guide](url) beats [click here](url) for accessibility (screen readers read the link text out of context) and for SEO. Second, group reference definitions at the bottom of the file, sorted in order of first appearance, so the prose stays clean and the link list stays scannable. The documentation best practices guide covers the larger discipline of link maintenance, including how to keep a reference-link block from drifting out of sync with the prose.

Images versus HTML img

Markdown's image syntax is borrowed directly from its link syntax with a leading exclamation point: ![alt text](url "optional title"). The syntax produces an <img> tag with the alt text and the URL, and that is the entire capability of the syntax. Markdown images cannot specify width, height, alignment, lazy loading, or any other attribute. When you need any of those, the right tool is the HTML <img> tag, written inline in the Markdown source.

When to use Markdown image syntax

Use ![alt](url) when the image is content — a diagram, a screenshot, a chart — and you do not need to control its display attributes. The renderer picks the natural size, the alt text provides the accessible alternative, and the title attribute (if you supply one) provides a tooltip. This is the right choice for most README images and most blog-post illustrations.

When to use HTML img

Use <img src="..." alt="..." width="..." height="..."> when any of the following apply: you need explicit width and height to prevent cumulative layout shift, you need loading="lazy" for an off-screen image, you need decoding="async", you need a CSS class for styling, or you need srcset for responsive images. Every one of those is an attribute that Markdown image syntax cannot express.

/* Markdown image: simple, no sizing control */
![Architecture diagram](/img/architecture.svg "System architecture")

/* HTML img: explicit dimensions prevent layout shift */
<img src="/img/architecture.svg"
     alt="Architecture diagram: client, API, and database tiers"
     width="800" height="400"
     loading="lazy" decoding="async">

/* HTML img: responsive via srcset */
<img src="/img/arch-800.svg"
     srcset="/img/arch-400.svg 400w, /img/arch-800.svg 800w"
     sizes="(max-width: 600px) 400px, 800px"
     alt="Architecture diagram at responsive widths"
     width="800" height="400">

One rule that applies to both forms: always include alt text. Alt text is the accessible name of the image; without it, screen readers fall back to the filename, and the image is invisible to anyone using assistive technology. Decorative images can use an empty alt (alt="") to signal that the image conveys no information; meaningful images need a real description. The image-attribute discipline covered here is the source-side of the larger performance story in the code minification best practices guide; the conversion workflows in the HTML to markdown conversion guide handle the inverse direction.

Tables: The GFM Extension

Tables are not in the original Markdown spec. They are a GitHub Flavored Markdown (GFM) extension, and that fact matters because the syntax does not travel to every renderer. CommonMark alone does not support the pipe-table syntax; some renderers support it but render it differently; some strip it entirely. When you use a table, you are writing GFM, and you should know that going in.

The pipe syntax

A GFM table is a header row, a separator row, and one or more data rows. The header and data rows use pipes (|) to separate columns; the separator row uses pipes with dashes (---) to mark the column boundary and an optional colon (:) to control alignment.

/* GFM table with explicit alignment */
| Format    | Extension | Use case            |
|:----------|:---------:|-------------------:|
| Markdown  | .md       | source-first docs  |
| HTML      | .html     | rendered output    |
| PDF       | .pdf      | print distribution |

/* Alignment markers */
|:---|         left-aligned column
|:--:|         centered column
|---:|         right-aligned column
|----|         default (left) alignment */

When tables are the wrong tool

Three anti-patterns are common enough to name. First, tables for layout — using a table to position a caption under an image, or to make two columns of unrelated text. That is a CSS job, and a table used for layout breaks on every narrow viewport. Second, tables for key-value pairs — a two-column table with property names in the left column and values in the right is usually clearer as a definition list or a bulleted list with bold keys. Third, wide tables on mobile — anything wider than three or four columns will overflow on a phone, and the right fix is usually to split the table into two narrower ones.

The portability question — whether a given renderer supports GFM tables — is the territory of the markdown platforms guide. The writing rule that travels: if the table is the right tool, keep it narrow, keep the columns aligned in source, and prefer definition lists or bulleted lists when the data is not actually tabular.

Raw HTML Escape Hatches

Markdown's most powerful extension is also its most abused: any raw HTML in the source passes through to the output. The rule that follows from that fact is simple to state and harder to follow — use raw HTML only when Markdown cannot express the semantics you need, and know the parser-specific limits before you reach for it.

Legitimate uses of raw HTML

Five cases justify the escape hatch. First, collapsible sections with <details> and <summary> — Markdown has no native equivalent, and the disclosure widget is a real semantic need. Second, image sizing and responsive attributes — covered in the previous section, the HTML <img> tag is the only way to control width, height, and srcset. Third, complex table structures — GFM tables cannot express colspan, rowspan, or table headers in a non-first row; raw HTML can. Fourth, legacy anchor names — <a name="..."> for anchors that pre-date slug-based auto IDs. Fifth, form and input elements — interactive content that Markdown cannot express at all.

What not to use raw HTML for

Do not use raw HTML for basic formatting that Markdown handles natively. <b> and <i> instead of ** and *; <br> instead of a blank line; <ul> and <li> instead of dashes — every one of these is a regression. The source stops reading as Markdown, the output is no better than what the native syntax produces, and you have locked the document into a renderer that accepts the specific HTML you wrote.

/* Legitimate: collapsible section */
<details>
<summary>Advanced configuration options</summary>

The full set of options is documented below. These are
rarely needed for most deployments.

</details>

/* Wrong: HTML for basic formatting */
This is a <b>bold</b> word and this is a <br>
line break.

/* Right: native Markdown */
This is a **bold** word and this is a
line break (with a blank line above for a real paragraph break).

Parser-specific limits to know

Three limits vary by renderer and will bite you if you do not check. First, safe mode strips raw HTML entirely — many CMS platforms and comment systems run Markdown through a sanitizing renderer that drops unknown HTML tags, so a <details> block you write may vanish without warning. Second, block-level HTML needs blank lines around it — CommonMark requires a blank line before and after a block-level HTML element so the parser knows where the HTML block begins and ends; without those blank lines, the surrounding Markdown may be absorbed into the HTML block. Third, inline HTML inside a paragraph works only for inline elements — <span> and <a> are fine mid-paragraph; <div> mid-paragraph will close the paragraph at the <div>.

The escape hatch is a tool, not a default. When you reach for it, name the reason in a comment so the next author knows why the HTML is there and when it can be removed. The wider discipline of when to migrate content between HTML and Markdown is covered in the HTML to markdown conversion guide, and the conversion tooling itself lives at the HTML to Markdown converter.

7 Common Markdown Mistakes (and the Fix for Each)

  1. Skipping heading levels. Going from H2 directly to H4 breaks the document outline for screen readers and any tool that builds a table of contents from headings. Fix: always step by one level; if you need a smaller visual heading, use CSS on the correct semantic level.
  2. Mixing emphasis styles. Using *bold* in one paragraph and _bold_ the next, or **bold** next to __bold__, produces inconsistent source that is hard to lint and harder to refactor. Fix: pick asterisks throughout, configure markdownlint rule MD050, and let the linter normalize legacy content.
  3. Missing blank lines around block elements. Headings, lists, code blocks, blockquotes, and tables all need a blank line before and after them; without it, the parser may absorb the surrounding text into the block. Fix: treat blank lines as the universal block separator, not as a stylistic choice.
  4. Using line breaks instead of paragraph breaks. Two trailing spaces (or a <br> tag) inside a paragraph produces a hard break, but many editors strip trailing whitespace on save and the break vanishes silently. Fix: prefer a blank line for paragraph separation; reserve the two-trailing-spaces trick for cases where the break is genuinely content (verse, addresses).
  5. Tables for layout. Using a GFM table to position a caption under an image or to make two columns of unrelated text is a CSS job, and the table breaks on every narrow viewport. Fix: use tables only for tabular data; use CSS or definition lists for everything else.
  6. Inconsistent list markers. Mixing dashes, asterisks, and plus signs in the same document, or mixing lazy 1. with explicit 1. 2. 3. ordering, produces noisy diffs and lint failures. Fix: pick one unordered marker (dash) and one ordered style (lazy), and enforce both with lint rules.
  7. Hard-coded ordered list numbers. Writing 1. 2. 3. 4. 5. in source means inserting an item between 2 and 3 requires renumbering every line below it, which is exactly the kind of edit that introduces off-by-one errors. Fix: use lazy 1. 1. 1. numbering for any list that may be reordered; reserve explicit numbering for lists where the numbers are referenced elsewhere in the text.

Each of these is fixable with a lint rule and a few minutes of normalization, which is why every team that ships Markdown at scale ends up with a markdownlint config in CI. The linter setup is part of the wider developer workflow covered in the developer tools guide, and the lint-config discipline is one of the documentation habits in the documentation best practices guide.

Frequently Asked Questions

Use ATX headings (# Heading, ## Subheading) over Setext underlining (Heading followed by === or ---). ATX supports all six levels, sits on a single line that is easy to move and grep, and is the default in modern parsers and linters. Setext only supports H1 and H2, requires a second line of punctuation that breaks when copied, and is silently dropped by some tools. The only place Setext still appears is in older hand-written READMEs, and converting them to ATX is a safe, one-time cleanup.

Yes. In CommonMark and most GFM parsers, two trailing spaces followed by a newline render as a hard line break (an HTML <br> tag). A single newline inside a paragraph is treated as a soft wrap and joins into the same paragraph. The trap is that many editors strip trailing whitespace on save, silently removing the break. For poetry, addresses, and tables of contents where the break matters, prefer an explicit blank line for paragraph separation, and reserve the two-space trick for cases where you genuinely need a break inside a paragraph. Some style guides disable the convention entirely in their linter config to avoid surprises.

Use asterisks (*italic* and **bold**) as the default. Underscores (_italic_ and __bold__) only parse as emphasis at word boundaries, so un*fricking*believable works with asterisks but not with underscores. Asterisks also match the convention of every major style guide and lint rule, and they read more clearly in monospace editors because they do not collide with identifiers like snake_case_var. Pick one, configure markdownlint to enforce it, and let the linter normalize legacy content.

Use reference links ([text][id] with a [id]: url "title" block at the bottom of the file) when the same URL is repeated many times, when URLs are long and would break the prose flow, or when the document is read in source form as often as it is rendered. Inline links ([text](url)) win for short, single-use URLs because the reader does not have to jump to a footnote to see where the link goes. The maintainability win of reference links is real but the readability cost is too, so prefer them for long reference-style documents like API guides and changelogs rather than short blog posts.

Use raw HTML sparingly and only when Markdown cannot express the semantics you need. Legitimate cases include <details>/<summary> for collapsible sections, <img> tags when you need explicit width and height to prevent layout shift, <a name="anchor"> for legacy anchor names, and complex table structures that GFM tables cannot represent. Avoid HTML for basic formatting that Markdown handles natively, because raw HTML reduces source readability, breaks in safe-mode parsers, and complicates export to other formats. Block-level HTML elements need blank lines around them so the parser does not treat surrounding Markdown as part of the HTML block.

Markdown is a family of dialects, not one format. Stick to the CommonMark baseline for maximum portability, add GFM extensions (tables, strikethrough, task lists, autolinks) only where you know the target supports them, and avoid parser-specific tricks like attribute extensions or custom fence characters. Lint with markdownlint, render in two or three target environments before publishing, and remember that some platforms strip raw HTML, some render GFM tables, and some treat single newlines as hard breaks. When in doubt, write the source so it reads correctly in plain text and the rendered output is a bonus, not a requirement.

Regex Testing Guide

The pillar article for cluster 16: the unified theory of regex testing, debugging, and pattern validation.

Regex Tester Guide

Regex tester mechanics and use cases: pattern anatomy, capture groups, lookahead and lookbehind in practice.

Regex Tester Ultimate Guide

Advanced regex patterns, lookarounds, backreferences, and the patterns every senior developer should recognize.

Regex Tester Developer Guide

Developer workflows for regex: testing patterns in CI, debugging failures, and integrating regex checks into pipelines.

Markdown Platforms

Which Markdown renderer supports what — GFM, CommonMark, MDX, and the dialect matrix for every major platform.

GitHub Markdown Guide

GitHub-Flavored Markdown specifics: task lists, alerts, autolinks, and the GFM extensions that ship on GitHub.

HTML to Markdown Conversion Guide

Conversion workflows: when and how to migrate HTML content to Markdown, and what does not survive the trip.

Code Minification Best Practices: CSS & JS Performance Gains

Minification for the assets Markdown embeds: CSS and JS performance gains without breaking the rendered output.

Static Site Generators

Jekyll, Hugo, Eleventy compared: which static site generator turns Markdown into which kind of site.

Developer Tools Guide

The developer tool suite overview: linters, formatters, converters, and the lint config that ties them together.

UUID Generator Developer Guide

UUID mechanics and developer use cases: versioning, uniqueness guarantees, and when a UUID belongs in your docs.

Data Conversion Tools Professional Workflows

Conversion workflows for pros: JSON, CSV, YAML, Markdown, and the format-to-format pipeline that keeps data honest.

Conclusion: Markdown That Reads in Source and Renders in Output

Writing Markdown well is two skills at once. The first is choosing syntax that reads correctly in plain text — ATX headings that fit on one line, asterisks that survive mid-word, fenced code blocks that name their language, reference links that keep long URLs out of the prose. The second is choosing syntax that parses to the semantic HTML you actually want — one H1 per document, no skipped heading levels, code spans for tokens, definition lists for key-value pairs. When the two skills agree, the source is the documentation and the rendered output is a faithful echo; when they disagree, the source is a chore and the rendered output is a surprise.

The conventions in this guide are the ones that travel across CommonMark, GFM, and the major static-site generators without reformatting. The platform-specific behaviors — exactly which extensions a given renderer supports — are catalogued in the markdown platforms guide and the GitHub markdown guide, and the conversion paths between HTML and Markdown are covered in the HTML to markdown conversion guide. When you are ready to move from reading to writing, the markdown editor renders your source live, and the wider catalog of developer guides is on the NoCostTools blog.