Markdown cheat sheet

Markdown formats plain text with symbols: # for headings, * for emphasis, - for lists. Each section shows the syntax and the result.

Headings

Start a line with one to six # characters and a space. One # is the biggest heading (the document title); use each level in order.

Markdown
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
Result

Heading 1

Heading 2

Heading 3

Heading 4

Alternative: underline a line with === (level 1) or --- (level 2).

Paragraphs and line breaks

Separate paragraphs with a blank line. For a line break inside a paragraph, end the line with a backslash (or two spaces).

Markdown
This is the first paragraph.

This is the second one,\
with a line break.
Result

This is the first paragraph.

This is the second one,
with a line break.

Bold, italic and strikethrough

Wrap text in one asterisk for italic, two for bold, three for both, and two tildes to strike it through. Underscores work too.

Markdown
*italic* or _italic_
**bold** or __bold__
***bold and italic***
~~strikethrough~~
Result

italic or italic bold or bold bold and italic strikethrough

Lists

Start lines with -, * or + for a bulleted list, or a number and a period for a numbered list. Indent by two to four spaces to nest.

Markdown
- Apples
- Oranges
  - Blood oranges

1. First
2. Second
3. Third
Result
  • Apples
  • Oranges
    • Blood oranges
  1. First
  2. Second
  3. Third

Numbered lists count from the first number, so you can write 1. on every line and still get 1, 2, 3.

Task lists

A list item starting with [ ] becomes a checkbox; [x] is ticked. In Hashlite you can tick a box by clicking it in the preview.

Markdown
- [x] Write the draft
- [ ] Review it
- [ ] Publish
Result
  • Write the draft
  • Review it
  • Publish

Images

Like a link, with an exclamation mark in front. The text in brackets is the alt text that describes the image for screen readers and search engines.

Markdown
![A purple hash sign](https://example.com/cat.jpg)
Result

A purple hash sign

In Hashlite you can also paste, drop or upload an image and the Markdown is written for you.

Code and syntax highlighting

Wrap inline code in backticks. For a code block, put three backticks on the lines above and below; add a language name for syntax highlighting.

Markdown
Run `npm start` to begin.

```js
function greet(name) {
  return `Hello, ${name}!`;
}
```
Result

Run npm start to begin.

function greet(name) {
  return `Hello, ${name}!`;
}

Common language names: js, ts, python, bash, json, html, css, sql.

Tables

Separate columns with pipes | and put a line of dashes under the header row. Colons in that line align a column left, center or right.

Markdown
| Item    | Qty | Price |
| :------ | :-: | ----: |
| Coffee  |  2  | $3.50 |
| Bagel   |  1  | $2.25 |
Result
Item Qty Price
Coffee 2 $3.50
Bagel 1 $2.25

The columns don't need to line up in the source; the pipes are what count. Hashlite's toolbar can insert a table for you. More in Markdown tables.

Blockquotes

Start a line with > to quote it. Quotes can contain other Markdown and can be nested with >>.

Markdown
> Simplicity is the ultimate sophistication.
>
> > A nested quote.
Result

Simplicity is the ultimate sophistication.

A nested quote.

Callouts (alerts)

A blockquote that starts with [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] becomes a highlighted callout, the same syntax GitHub uses.

Markdown
> [!NOTE]
> Useful information worth knowing.

> [!WARNING]
> Something that needs attention.
Result

Note

Useful information worth knowing.

Warning

Something that needs attention.

Horizontal rules

Three or more dashes, asterisks or underscores on a line of their own draw a dividing line. Leave a blank line above dashes, or they turn the line above into a heading.

Markdown
Above the line

---

Below the line
Result

Above the line


Below the line

Footnotes

Add [^label] where the note belongs and define it anywhere in the document. Footnotes are numbered and collected at the bottom.

Markdown
Markdown was created in 2004.[^1]

[^1]: By John Gruber, with Aaron Swartz.
Result

Markdown was created in 2004.[1]


  1. By John Gruber, with Aaron Swartz. ↩︎

Math (LaTeX)

Write LaTeX between single dollar signs for inline math and between double dollar signs for a block. Hashlite renders it with KaTeX.

Markdown
Euler: $e^{i\pi} + 1 = 0$

$$
\sum_{k=1}^{n} k = \frac{n(n+1)}{2}
$$
Result

Euler: eiπ+1=0e^{i\pi} + 1 = 0

∑k=1nk=n(n+1)2\sum_{k=1}^{n} k = \frac{n(n+1)}{2}

More examples in math and diagrams in Markdown.

Diagrams (Mermaid)

Write a Mermaid diagram in a code block with the language mermaid: flowcharts, sequence diagrams, Gantt charts, pie charts and more are drawn in the preview.

Markdown
```mermaid
flowchart LR
  Write --> Preview --> Share
```
Result

Highlight

Wrap text in two equals signs to highlight it, like a marker pen.

Markdown
This is ==really important==.
Result

This is really important.

Emoji

Type an emoji name between colons. You can of course also paste emoji directly.

Markdown
Ship it :rocket: :tada: :white_check_mark:
Result

Ship it 🚀 🎉 ✅

A few favourites: :smile:, :+1:, :heart:, :warning:, :bulb:, :memo:.

YAML front matter

A block of YAML between --- lines at the very top of a document holds metadata such as a title, date or tags. Static site generators read it; Hashlite shows it as a small collapsible box instead of as text.

Markdown
---
title: Release notes
date: 2026-09-01
tags: [docs, release]
---

# Release notes
Result
Front matter
title: Release notes
date: 2026-09-01
tags: [docs, release]

Release notes

Escaping characters

Put a backslash before a character that Markdown would otherwise treat as formatting, such as \*, \_, \#, \[, \` or \|.

Markdown
\*Not italic\* and 1\. not a list

Use \`backticks\` literally.
Result

*Not italic* and 1. not a list

Use `backticks` literally.

Try any example with a live preview in Hashlite.