Earn it: GitHub Achievements Academy home

Writing Markdown on GitHub

Markdown is the simple formatting language behind READMEs, issues, pull requests, comments, Discussions and wikis on GitHub. You type plain text with a few symbols, and GitHub turns it into formatted text. Ten minutes with this page covers almost everything you'll need.

Every comment box on GitHub has a Preview tab. Use it to check your formatting before you post.

Text

You typeYou get
**bold**bold
*italic*italic
~~struck through~~struck through
`inline code`inline code
[link text](https://example.com)link text

Leave a blank line between paragraphs. A single line break is ignored in files like README.md.

Headings

# Page title (use once, at the top)
## Section
### Sub-section

Use headings in order, without skipping levels. Screen-reader users navigate by them, and GitHub builds a table of contents from them (the list icon at the top of a README).

Lists

- An item
- Another item
  - Indent two spaces for a nested item

1. First step
2. Second step

- [ ] A task to do
- [x] A finished task

Task lists in issues and pull requests can be ticked by clicking, and GitHub shows progress ("2 of 5 tasks").

Code

Wrap code in three backticks, and name the language for syntax highlighting:

```js
const total = items.reduce((sum, i) => sum + i.price, 0);
```

Use bash for commands, diff to show changes, and suggestion in a review comment to propose an exact change (GitHub 3).

Images

![Screenshot of the checkout page with the total highlighted](docs/checkout.png)

Always write alt text (the words in square brackets) that describes what the image shows. It's what screen-reader users hear, and what everyone sees if the image fails to load. To add an image to an issue or PR, paste or drag it into the comment box, then edit the alt text GitHub inserts.

Tables

| Command      | What it does           |
|--------------|------------------------|
| `git status` | Shows what changed     |
| `git log`    | Shows commit history   |

Keep tables small and give every column a header. For long content, a list is often easier to read, especially on phones.

GitHub extras

You typeWhat it does
#42Links to issue or PR 42 in this repo
owner/repo#42Links to an issue in another repo
@usernameMentions someone, and notifies them
@org/teamMentions a team
A commit ID like a1b2c3dLinks to that commit
Fixes #42 in a PRCloses issue 42 when the PR merges (GitHub 2)

Only mention people who need to see something. Every @ sends a notification.

Alerts

> [!NOTE]
> Useful information people should know.

> [!WARNING]
> Something that could cause problems.

The other alert types are [!TIP], [!IMPORTANT] and [!CAUTION]. Use them sparingly, or they lose their effect.

Collapsed sections

<details>
<summary>Full error log</summary>

Paste long logs here so they don't swamp the conversation.

</details>

Writing that helps people

  • Lead with the point. The first sentence of a README, issue or PR should say what it's about.
  • Use descriptive link text. "Read the install guide" rather than "click here". Screen readers often list links out of context.
  • Don't rely on color or emoji alone to carry meaning. Say it in words too.
  • Keep lines of code in code blocks, not screenshots, so people can copy them and screen readers can read them.

Exercise

  1. In your sandbox repo, edit README.md. Add a heading, a short list, a code block and a link.
  2. Open a new issue that uses a task list and an alert, and check it with Preview first.
  3. Add an image with good alt text.

What you learned

  • Text, headings, lists, code, images and tables in Markdown
  • GitHub extras: references, mentions, alerts and collapsed sections
  • Writing habits that make your text clearer and more accessible

Last reviewed November 2026. Improve this page on GitHub. Every fix you send counts toward Pull Shark.