Markdown cheat sheet with examples
Try it now: Markdown Previewer, free and private in your browser.
Open Markdown PreviewerMarkdown is a plain-text way to format writing. You will meet it in README files, documentation, notes apps and blogs. This cheat sheet covers the syntax you will use every day.
Headings
# Heading 1
## Heading 2
### Heading 3
More # symbols mean a smaller heading. Keep a space after the hashes.
Bold, italic and strikethrough
**bold**
*italic*
***bold and italic***
~~strikethrough~~
Lists
- Item one
- Item two
- Nested item
1. First
2. Second
Links and images
[Link text](https://example.com)

An image is a link with an exclamation mark in front. Always write useful alt text.
Code
Wrap inline code in single backticks. For a block, use three backticks and add the language name after them:
`inline code`
```js
console.log("Hello");
```
Blockquotes and rules
> A quoted line
---
Tables
| Name | Role |
|-------|--------|
| Ana | Editor |
| Sam | Writer |
The row of dashes separates the header from the body. Columns do not need to line up, but it is easier to read when they do.
Task lists
- [x] Write draft
- [ ] Add images
Line breaks and paragraphs
A blank line starts a new paragraph. To force a line break inside one, end the line with two spaces. To show a special character literally, put a backslash in front of it.
Practice with a live preview
The fastest way to learn is to type it and watch it render. Open the previewer, edit the example, and use the toolbar for the common formats. Flavors differ slightly between sites, but tables, task lists and fenced code are supported on GitHub and most modern tools.
FAQ
- What is Markdown used for?
- Documentation, README files, notes, blog posts and chat messages, anywhere you want simple formatting from plain text.
- Is Markdown the same everywhere?
- The basics are. Extras such as tables and task lists come from GitHub Flavored Markdown and are widely supported.
- How do I add a line break?
- End the line with two spaces, or leave a blank line for a new paragraph.
- Can I use HTML inside Markdown?
- Most renderers allow it, but many strip scripts and unsafe attributes for security.