← Back to blog/Guides

Markdown Cheat Sheet: A Practical Syntax Reference

An original Markdown reference with copyable syntax, whitespace rules, extension boundaries, and a complete starter document for technical guides.

F
Faizan Khan
• 9 min read

This Markdown cheat sheet covers portable document syntax first, then labels GFM extensions and platform-specific features separately. Use headings, paragraphs, lists, links, images, and code for the core document; check your renderer before relying on tables, checkboxes, footnotes, alerts, or embedded HTML. The examples are source you can adapt, not a promise that every Markdown application has identical features.

New to the file format? Start with what Markdown is and how to open a .md file. For exact parsing rules, use the CommonMark specification and the GFM specification.

Core syntax at a glance

PurposeSourceImportant detail
Heading## Review the resultA space separates markers from the heading
Strong emphasis**Required**Delimiters touch the text
Emphasis*Optional*Asterisks are convenient within words
Inline code`mode`Contents are literal, not emphasized
Link[Reference](https://example.com)Use descriptive visible text
Image![Useful description](./image.png)The file must exist at the resolved path
Bullet- Check the outputKeep a space after the marker
Numbered item1. Open the fileThe first number sets the starting value
Quote> Quoted textPrefix blank quoted lines too
Thematic break***Put it on a separate line
Literal punctuation\*not emphasis\*Escapes apply outside code

The table itself uses GFM table syntax. The features it describes in this section are core constructs; the reference format does not make every table portable to a core-only renderer.

Headings and paragraphs

Use one to six hash marks for heading levels:

Markdown
1# Document title
2
3## Main task
4
5### A subtask within the main task

Choose levels for hierarchy, not font size. A publishing system may already supply the page title, in which case the article body normally begins below that level rather than repeating it.

Separate paragraphs with a blank line. A single source newline is usually a soft break within one paragraph:

Markdown
1This source line wraps
2without starting a separate paragraph.
3
4This is a separate paragraph.

To request a hard break in the same paragraph, end the line with a backslash or two spaces. The backslash is easier to inspect:

Markdown
1Delivery location:\
2Receiving desk, Building 4

See line breaks for trailing-whitespace failures. Extra blank lines are not a reliable way to create larger page margins.

Emphasis, code, and escapes

Markdown
1**Required:** Keep the original file.
2*Optional:* Add a reviewer note.
3***Read the warning before continuing.***
4
5Set `mode` to `preview`.
6Show literal markers: \*\*Required\*\*.

Use code for literal fields, values, and filenames, not as a generic visual highlight. An escaped asterisk in prose is not the same as a backslash inside code; code normally keeps that backslash as sample text.

For a literal backtick inside an inline span, use a longer delimiter:

Markdown
1The source `` `mode` `` includes backticks around the field.

Underline, color, subscript, superscript, and arbitrary font sizes require additional support. The text-formatting guide shows HTML and MDX alternatives without presenting them as universal syntax.

Lists and nested content

Markdown
1- A source file
2- A reviewer
3
41. Prepare the draft.
5 - Check the headings.
6 - Confirm the image paths.
72. Review the output.
8
9 Keep this second paragraph inside step two.
103. Publish after approval.

Indent child content to the parent's text column. With one space after the marker, - needs two spaces, 1. needs three, and 10. needs four. Top-level four-space indentation can create code instead of prose.

Blank lines can turn a compact list into a loose list with paragraph wrappers. If numbering restarts after a paragraph or fence, check that the intervening block still belongs to the item. The list guide and indentation guide cover the structural rules.

Links and images

Markdown
1[External reference](https://example.com/reference)
2[Local guide](./review.md)
3[Same-page section](#review-the-result)
4
5[Read the specification][spec]
6
7[spec]: https://spec.commonmark.org/0.31.2/
8
9![Export settings with CSV selected](./images/export.png)
10[![Open the export guide](./images/export.png)](./export.md)

Relative destinations depend on the reading surface. A repository filename and a published site route can differ. Heading IDs also depend on the renderer; copy a rendered permalink rather than guessing punctuation rules.

Alternative text should explain what the image contributes. Optional image titles are not dependable captions. Standard image syntax does not define width or height, and GIF files use the same image syntax as static assets.

Use the dedicated references for links, images, image sizing, and tables of contents when paths or layout are the problem.

Quotes and thematic breaks

Markdown
1> Example review message:
2>
3> The file opens, but one screenshot is missing.
4
5Check the asset path before continuing.
6
7***
8
9The next phase begins here.

Keep attribution distinct from quoted wording. >> can create a nested quote, but deep nesting is rarely easy to read. Our blockquote guide shows lists and code inside quotes.

For a horizontal line, use three matching asterisks, hyphens, or underscores on their own line. Hyphens immediately below text can instead form a heading underline; add a blank line when you mean a divider.

Fenced code blocks

Markdown
1```json
2{
3 "mode": "preview"
4}
5```

Use a language label that describes the sample. It is a highlighting hint, not a validation result. Use text for neutral output and separate shell prompts or results from copyable commands.

When the sample contains a three-backtick fence, use four backticks for the surrounding fence. Tilde fences are another option. Keep the closing character consistent with the opener, and indent the whole block appropriately when it belongs inside a list. See code blocks for full examples.

GFM tables, checkboxes, and strikethrough

These features require extensions beyond core CommonMark:

Markdown
1| Check | Result | Owner |
2| :--- | :---: | ---: |
3| Headings | Ready | Reviewer |
4| Images | Pending | Author |

The delimiter row establishes a table, and colons request column alignment. To include a literal pipe in a cell, escape it as \|, including when it appears within inline code under GFM's table rules. Avoid complex multiline content in cells; a list or separate section is often clearer.

For larger tables, the existing Markdown table generator can help prepare the source. Still review header meaning and narrow-screen readability.

Markdown
1- [x] Review headings.
2- [ ] Check image paths.
3
4Previous wording: ~~Publish immediately~~.
5Current instruction: Publish after review.

A rendered checkbox is not necessarily clickable or saved. A strike does not by itself explain whether text is obsolete, deleted, or completed. See task lists and strikethrough for the limits.

Footnotes and platform features

With a footnote extension:

Markdown
1The rule follows the linked specification.[^source]
2
3[^source]: [CommonMark Images](https://spec.commonmark.org/0.31.2/#images).

Footnotes are not defined by the formal GFM specification even though GitHub supports them on selected surfaces. A bibliography citation processor is another separate capability. Read footnotes and citations before relying on export behavior.

For a portable note:

Markdown
1> **Note:** This example uses the default layout.

For a GitHub-specific alert:

Markdown
1> [!WARNING]
2> Keep a copy before replacing the file.

Other systems may display the alert token literally. The callout guide explains labels, placement, and actionable warning content.

HTML, comments, and disclosures

Where raw HTML is permitted:

HTML
1<!-- Harmless editorial note, still visible in source. -->
2
3<details>
4<summary>Show optional review details</summary>
5
6Additional information belongs here.
7
8</details>

Comments do not make information private. A details disclosure hides optional content visually, not from the source, and should not hide the only warning before a risky action. MDX uses JSX comments such as {/* note */} rather than HTML comments.

Check comments and collapsible sections for syntax boundaries, HTML filtering, and default-open behavior.

A complete starter document

This template deliberately uses core features so it can serve as a baseline compatibility test. Replace the task and file references before publishing:

Markdown
1# Review an export
2
3Use this procedure to check an exported document before sharing it.
4
5## Before you begin
6
7- Keep the original file.
8- Confirm that a reviewer can open the destination folder.
9
10## Review the result
11
121. Open the exported file.
132. Confirm that the expected headings are present.
143. Check the example output:
15
16 ```text
17 Review status: ready
18 Missing assets: 0
19 ```
20
214. Open each image and follow each relevant link.
22
23**Expected result:** The reviewed file contains the required content.
24
25## If the review fails
26
27Record the missing section or asset before trying again.
28
29## Reference
30
31[Markdown syntax specification](https://spec.commonmark.org/0.31.2/)

Before publishing

Preview in the destination renderer, not only an unrelated editor. Check whitespace, nesting, actual asset availability, and every link. Search for stale editorial notes, test copyable examples, and read the page at a narrow width. A successful parse does not establish that instructions are accurate or warnings appear at the right point.

FAQ

Which Markdown syntax is most portable?

Core headings, paragraphs, emphasis, lists, links, images, blockquotes, and code are the safest baseline. Confirm extensions and raw HTML support separately.

Why does the same Markdown render differently in two tools?

The tools may use different parsers, extensions, HTML sanitizers, or styles. Test the features your document actually needs in its intended destination.

Are tables and checkboxes part of CommonMark?

No. They are extensions provided by GFM and many other systems. A core-only renderer may leave their syntax as ordinary text.

Is MDX interchangeable with a Markdown file?

No. MDX adds JSX and JavaScript-related capabilities. Components, expressions, and comment syntax can require a different compilation pipeline.

Continue This Guide