WikiPlus

Markdown Cheat Sheet: Quick Reference for Developers

This Markdown cheat sheet covers every syntax element you need as a developer or technical writer. Organized for quick scanning rather than sequential reading, it gives you the exact syntax for headings, emphasis, lists, links, images, code blocks, tables, GFM extensions, and HTML escaping — all in one page. Bookmark this page and use WikiPlus Markdown Preview to test any syntax that looks unfamiliar. All examples follow CommonMark specification with GFM extensions noted where they differ.

Headings, Paragraphs, and Block Elements

HEADINGS # H1 Heading ## H2 Heading ### H3 Heading #### H4 Heading ##### H5 Heading ###### H6 Heading Note: always add a space between # and the heading text. PARAGRAPHS Separate paragraphs with a blank line. A single line break within a block does not create a new paragraph. LINE BREAKS End a line with two or more spaces, then press Enter for a line break without a new paragraph. Or use an explicit <br> HTML tag. HORIZONTAL RULE Three or more hyphens, asterisks, or underscores on their own line: --- *** ___ BLOCKQUOTES > This is a blockquote. > Continuation of the same blockquote. > Nested: > > Second level > > > Third level Blockquotes support Markdown inside them — bold, lists, code, etc. FENCED CODE BLOCKS ```language Code here ``` Replace 'language' with: javascript, python, bash, yaml, json, sql, etc. INDENTED CODE BLOCKS (legacy, avoid) Four spaces at the start of a line creates a code block. No language hint possible with this method.

Emphasis, Inline Code, and Inline Elements

TEXT EMPHASIS *italic* or _italic_ **bold** or __bold__ ***bold italic*** or ___bold italic___ ~~strikethrough~~ (GFM extension) Best practice: use asterisks (*), not underscores, inside words: This_is_tricky vs This*is*fine INLINE CODE `single backtick code` `` code with a `backtick` inside `` SUBSCRIPT / SUPERSCRIPT (HTML fallback) H<sub>2</sub>O E=mc<sup>2</sup> HIGHLIGHT (HTML fallback) <mark>highlighted text</mark> KEYBOARD KEYS (HTML) <kbd>Ctrl</kbd>+<kbd>C</kbd> ESCAPING SPECIAL CHARACTERS Use a backslash before: \` \* \_ \{ \} \[ \] \( \) \# \+ \- \. \! HTML ENTITIES &amp; = & &lt; = < &gt; = > &quot; = " &apos; = ' &copy; = © &reg; = ® &trade; = ™ &mdash; = — &ndash; = – &hellip; = … AUTO LINKS <https://example.com> <user@example.com> GFM: bare URLs like https://example.com auto-link without brackets.

Links, Images, and Lists

LINKS Inline: [Link text](https://example.com) With title: [Link text](https://example.com "Title on hover") Reference style: [Link text][ref-label] [ref-label]: https://example.com Anchor link: [Jump to section](#section-heading-id) IMAGES Inline: ![Alt text](image.jpg) With title: ![Alt text](image.jpg "Image title") Reference: ![Alt text][img-label] [img-label]: image.jpg With size (HTML): <img src="image.jpg" width="400" alt="Alt text"> UNORDERED LISTS - Item one - Item two - Nested (indent 2 spaces) - Deeper nest (indent 4 spaces) - Item three + Plus style * Asterisk style (Pick one and be consistent within a document) ORDERED LISTS 1. First item 2. Second item 1. Nested ordered 3. Third item (Numbers do not have to be sequential — parsers auto-count) TASK LISTS (GFM) - [ ] Unchecked task - [x] Checked task - [ ] Another unchecked task DEFINITION LISTS (some parsers, not CommonMark) Term : Definition text here

Tables, Footnotes, and Miscellaneous GFM

GFM TABLES | Left | Center | Right | | :--- | :---: | ---: | | data | data | data | | data | data | data | Rules: - Header row required - Separator row required (at least 3 dashes per cell) - Same column count in every row - Colons control alignment: left :--- right ---: center :---: FOOTNOTES (GFM / extended) Inline reference: This is true.[^1] At the bottom: [^1]: Footnote explanation here. MATH (GitHub Markdown) Inline: $E = mc^2$ Block: $$ \frac{d}{dx}(x^n) = nx^{n-1} $$ MERMAID DIAGRAMS (GitHub Markdown) ```mermaid graph LR; A --> B --> C; ``` GITHUB ALERTS (GitHub-specific) > [!NOTE] > Informational note. > [!WARNING] > Warning callout. > [!TIP] > Helpful tip. COLLAPSIBLE SECTION (HTML in Markdown) <details> <summary>Summary text (visible)</summary> Hidden content here. Blank lines needed for Markdown inside. </details> COMMENT (HTML, not visible in output) <!-- This comment will not appear in rendered output -->

Frequently Asked Questions

How do I add a line break inside a table cell in Markdown?
GFM tables do not support multi-line cell content natively. The most portable workaround is to use an HTML `<br>` tag inside the cell: `| First line<br>Second line |`. This works in GitHub-rendered Markdown and most other GFM renderers. Some parsers also support HTML paragraph tags inside cells for more complex content. If a cell regularly needs multiple lines, reconsider whether a table is the right structure or whether the content should be a list or a series of headings instead.
Can I add CSS classes to Markdown elements?
Not in standard CommonMark or GFM. HTML tags inside Markdown can have class attributes — `<div class="warning">...</div>` — which your CSS can style. Some extended Markdown dialects (Pandoc Markdown, kramdown) support attribute syntax like `{.class-name}` appended to elements. Docusaurus supports Markdown directive syntax for admonitions. For most purposes, inline HTML is the practical solution when you need CSS classes on specific elements.
What does 'frontmatter' mean in Markdown files?
Frontmatter is a YAML (or sometimes TOML or JSON) block at the very top of a Markdown file, delimited by triple dashes (---). It contains metadata about the document: title, date, author, tags, slug, and any other fields your publishing system uses. Frontmatter is not Markdown — it is parsed separately by the static site generator or CMS before the Markdown content is processed. Example: `---\ntitle: My Post\ndate: 2026-05-12\ntags: [markdown, tutorial]\n---` followed by the Markdown body.