MarkdownViewer

Markdown Syntax: The Complete Reference

Markdown is a plain-text formatting syntax: you type a few punctuation characters and a renderer turns them into headings, lists, links and code. The whole language is small enough to learn in one sitting, and the reference below covers the elements you will use almost every day.

Headings, emphasis and paragraphs

  1. Heading — one to six # at the start of a line: `# H1`, `## H2` … `###### H6`
  2. Bold — two asterisks or underscores: `**bold**` or `__bold__`
  3. Italic — one asterisk or underscore: `*italic*` or `_italic_`
  4. Bold italic — three: `***both***`
  5. Strikethrough (GFM) — `~~struck~~`
  6. A blank line starts a new paragraph; a single newline usually does not.

Lists and tasks

  1. Unordered — `- item`, `* item` or `+ item`
  2. Ordered — `1. item`, `2. item` (numbers are automatic)
  3. Nested — indent by two or four spaces under the parent
  4. Task list — `- [ ] todo` and `- [x] done`

Links, images and code

  1. Link — `[text](https://example.com)`
  2. Image — `![alt text](image.png)`
  3. Inline code — backticks: `` `code` ``
  4. Code block — three backticks, with an optional language: ```` ```js ````
  5. Reference link — `[text][id]` with `[id]: https://…` defined elsewhere

Blocks and tables

  1. Blockquote — `> quoted text`
  2. Horizontal rule — three or more `---`, `***` or `___`
  3. Table — a header row, a `| --- |` separator row, then data rows
  4. Line break — two trailing spaces, or a blank line

Frequently Asked Questions

Do all Markdown apps support the same syntax?
No. Basic Markdown is standardised; tables, task lists, strikethrough and autolinks come from GitHub-Flavoured Markdown (GFM) and are supported by GitHub, GitLab, many editors and this site. Syntax highlighting in code blocks is also a common extension.
How do I put a literal asterisk in text?
Escape it with a backslash: `\*` renders as a literal asterisk. The same works for backticks, underscores and other special characters.
Which is better for emphasis, asterisks or underscores?
Use asterisks. Underscores are ambiguous inside words and many renderers only treat them as emphasis at word boundaries, so asterisks are more predictable.
How many spaces indent a nested list?
Two spaces is the minimum and four is the classic convention; consistency within a document matters more than the exact number.

Related Markdown Tools