Markdown guide
Rather than list the syntax, this guide builds one document — a short project README — a piece at a time, so you see why each rule exists. The finished file is at the bottom.
Updated September 2026
Start with headings
One to six # characters, then a space, then the text. The number of hashes is the level, not the size: # is the document title, ## a major section, ### a subsection. Do not skip levels for visual effect — screen readers and table-of-contents generators read the structure, and most renderers build anchor links from it.
Use exactly one # per document. Everything below it steps down. Two details matter: the space after the hashes is required in strict parsers, and a heading needs a blank line before it if a paragraph sits directly above.
You type
# Ledger
## Getting started
### RequirementsYou get
Ledger
Getting started
Requirements
Paragraphs, and the line break trap
A paragraph is one or more lines of text with a blank line above and below. Markdown ignores single newlines inside a paragraph and joins the lines together, which surprises almost everyone the first time — an address or a poem collapses into one run-on line.
There are three fixes. A blank line makes a new paragraph, which is usually what you want. Two trailing spaces at the end of a line force a break inside the same paragraph; they are invisible, so many editors strip them. A backslash at the end of the line does the same thing and is visible in the source, which is why it is the safer habit.
You type
First paragraph.
Second paragraph, which
wraps onto one line.
Acme Ltd\
12 Bridge Street\
LeedsYou get
First paragraph.
Second paragraph, which wraps onto one line.
Acme Ltd
12 Bridge Street
Leeds
Emphasis
One asterisk either side for italic, two for bold, three for both, two tildes for strikethrough. Underscores work for italic and bold too, but asterisks are safer: snake_case_variables contain underscores, and some parsers italicise part of the word.
The markers must hug the text. **bold** works; ** bold ** renders the asterisks literally, because a space after the opening marker cancels it. To show a literal asterisk, put a backslash in front of it.
You type
**bold**, *italic*, ***both***, ~~struck out~~
\*not italic\* — a file named my_file_name stays intact.You get
bold, italic, both, struck out
*not italic* — a file named my_file_name stays intact.
Lists
Bullets start with -, * or + followed by a space. Pick one and stay with it; switching markers mid-list starts a second list in most parsers. Numbered lists start with 1., and the numbers you type after that are ignored, so a list written 1. 1. 1. still renders 1, 2, 3. That is handy when you insert a step in the middle.
Nest by indenting the child items, two spaces for bullets. Use spaces, never tabs: a tab is often read as a code block instead. Checklists and the rest of the detail are in the lists guide.
You type
- Install the CLI
- Configure it
- Add your API key
- Pick a region
1. Clone
1. Install
1. RunYou get
- Install the CLI
- Configure it
- Add your API key
- Pick a region
- Clone
- Install
- Run
Links and images
A link is the text in square brackets followed by the address in round brackets, with no space between the two brackets — that space is the single most common reason a link renders as literal text. An image is the same thing with an exclamation mark in front, and the bracketed text becomes the alt text rather than a visible label.
Bare URLs become clickable on their own in most renderers, including this one. If a URL contains spaces, replace each with %20 or the link breaks at the first space.
You type
See [the changelog](https://example.com/changelog).

Or just https://example.comYou get
Code and quotes
Wrap inline code in single backticks so a command keeps its own font and no character inside it is treated as formatting. For a block, put three backticks on their own line above and below, and write the language name after the opening fence to get syntax highlighting wherever the renderer supports it.
Block quotes start each line with a >. Add a second > to nest a quote inside a quote, and keep the > on the blank line between paragraphs so they stay in the same quote.
You type
Run `npm ci` first.
```bash
npm ci
npm test
```
> Merged after two approvals.
>
> — the contributing guideYou get
Run npm ci first.
npm ci
npm test
Merged after two approvals.
— the contributing guide
Tables
Tables are not in the original Markdown; they come from GitHub Flavored Markdown and work in nearly every modern renderer, this one included. A table is a header row, a divider row of dashes, then the body rows, with pipes between the cells.
The pipes do not need to line up — the columns are decided by the divider row, not by whitespace. Colons in that row set alignment: on the left for left, both ends for centre, the right for right. A table needs a blank line above it if text comes first. More, including how to escape a pipe, in the tables guide.
You type
| Command | What it does | Time |
| :--- | :---: | ---: |
| build | Compiles | 40s |
| test | Runs the suite | 12s |You get
| Command | What it does | Time |
|---|---|---|
| build | Compiles | 40s |
| test | Runs the suite | 12s |
Put it together
Every rule above, in one file, the way a real README looks. Three things worth noticing: blank lines separate every block, the table's pipes are not aligned and it renders correctly anyway, and the whole document is still readable as plain text — which is the point of the format.
You type
# Ledger
A small double-entry bookkeeping tool.
## Install
```bash
npm install ledger-cli
```
## Commands
| Command | Purpose |
| :-- | :-- |
| `ledger add` | Record a transaction |
| `ledger report` | Print a summary |
## Notes
- Data lives in `~/.ledger`
- See [the docs](https://example.com/docs)
> Back up before upgrading.You get
Ledger
A small double-entry bookkeeping tool.
Install
npm install ledger-cli
Commands
| Command | Purpose |
|---|---|
ledger add |
Record a transaction |
ledger report |
Print a summary |
Notes
- Data lives in
~/.ledger - See the docs
Back up before upgrading.
Where Markdown differs between apps
The core — headings, emphasis, lists, links, images, quotes, code — behaves the same everywhere. Beyond that, expect differences.
Slack and Discord support bold, italic, strikethrough and code but not headings, tables or inline [text](url) links. Obsidian adds [[wiki links]] and callouts. Notion accepts Markdown as you type but stores its own blocks. GitHub adds footnotes and > [!NOTE] alerts; this viewer supports neither of those, nor raw HTML, which is disabled so a pasted document can never inject markup into the page. When it matters, test the document where it will actually be read, and keep the cheat sheet open.
Frequently asked questions
How do I write in Markdown for the first time?
Open an editor with a preview, type a hash-sign heading, leave a blank line, then write a paragraph and add bullets with hyphens. Those three rules cover most documents; look up links and code when you need them.
Why does my text run together on one line?
Markdown joins consecutive lines into one paragraph. Leave a blank line for a new paragraph, or end a line with a backslash or two spaces to force a break inside one.
Do numbered lists have to be in order?
No. Only the first number matters; the rest are renumbered automatically. Many people write 1. on every line so inserting a step never means renumbering.
Can I use HTML inside Markdown?
Many renderers allow it, but plenty do not. GitHub allows a safe subset; this viewer disables raw HTML entirely, so any tags you paste appear as literal text.
What is the best way to practise Markdown?
Write something real — a README or meeting notes — in an editor with a live preview, so a mistake shows immediately rather than after you publish.
Write with a live preview beside the source, then export to Word, PDF or HTML.
