MarkdownViewer

Markdown Cheat Sheet: The Syntax You Actually Use

Markdown is small enough to learn in an afternoon, and this cheat sheet covers the syntax you will use ninety-nine percent of the time. Keep it open while you write, or paste an example straight into the viewer to confirm it renders the way you expect.

Text formatting

  1. **bold** renders as bold
  2. *italic* or _italic_ renders as italic
  3. ~~strikethrough~~ renders as strikethrough (GitHub-flavoured)
  4. `inline code` wraps text in a code span
  5. A blank line starts a new paragraph — a single line break usually does not

Headings

Prefix a line with one to six hashes followed by a space. Use a single h1 per document and keep the order logical, skipping levels only when the content genuinely demands it.

  1. # Heading 1
  2. ## Heading 2
  3. ### Heading 3
  4. #### Heading 4

Lists

  1. - starts an unordered list item; use * or + instead if you prefer
  2. 1. starts an ordered list; number order does not matter as long as it starts at 1
  3. Indent by two to four spaces to nest a list inside another
  4. - [ ] an unchecked task item
  5. - [x] a checked task item

Links and images

  1. [link text](https://example.com) creates a hyperlink
  2. [link text](https://example.com "Title") adds a hover title
  3. ![alt text](image.png) embeds an image
  4. <https://example.com> auto-links a bare URL in GFM
  5. [reference][1] with a [1]: https://example.com definition below lets you reuse links

Tables

A pipe table needs a header row, a separator row of dashes, and one row per record. Alignment is set with colons in the separator row. The pipes do not need to line up — the renderer ignores whitespace — but consistent spacing keeps the source readable.

  1. | Name | Value |
  2. | --- | --- |
  3. | Alpha | 1 |
  4. | Beta | 2 |

Code blocks

Wrap inline code in single backticks. For a block, use three backticks on their own lines, optionally followed by a language name to enable syntax highlighting in renderers that support it.

  1. ```js
  2. const greeting = 'hello';
  3. ```

Blockquotes and horizontal rules

  1. > starts a blockquote; stack >> to nest one level deeper
  2. > Blockquotes are often used for callouts and notes
  3. --- on its own line draws a horizontal rule (three or more dashes, asterisks or underscores)

Escaping and gotchas

  1. Put a backslash before a character to show it literally: \* prints an asterisk
  2. A line with two or more trailing spaces, or a trailing backslash, forces a line break
  3. Blank lines around block elements prevent list and paragraph merging
  4. Not every renderer supports every feature — preview before publishing

Frequently Asked Questions

Is Markdown the same everywhere?
No. CommonMark defines the core syntax, and platforms add extensions on top. GitHub-flavoured Markdown adds tables, task lists, autolinks and strikethrough. Most modern tools follow GFM, so learning it covers the widest range of platforms.
How do I add a line break inside a paragraph?
End the line with two or more spaces, or a backslash, then start the next line. Some renderers also treat any single newline as a break when a 'breaks' option is enabled, but trailing spaces are the portable approach.
Why is my table not rendering?
The most common cause is a missing or malformed separator row, or a row with fewer cells than the header. Preview the Markdown to see exactly where the table breaks, then align the pipe counts.
Can I use HTML inside Markdown?
Most renderers allow raw HTML and pass it through untouched, which is useful for things Markdown cannot express. Security-conscious renderers strip it, so avoid relying on HTML if your content will be shared widely.

Related Markdown Tools