Markdown Cheat Sheet: Syntax and Examples
Use this quick reference to create headings, lists, links, tables, code blocks, and more. Copy any example, then preview or export it with the free Markdown tools.
Markdown in one minute
Markdown uses simple punctuation to describe document structure. Add # before a heading, wrap text in ** for bold, use - for a list, and place link text inside square brackets. Core syntax works across most editors; tables, task lists, and strikethrough depend on GitHub Flavored Markdown or a similar extension.
Common Markdown syntax
Copy a snippet and replace the example text with your own content.
| Use | Syntax | Rendered result | Copy |
|---|---|---|---|
| Heading 1 | # Heading 1 | Heading 1 | |
| Heading 2 | ## Heading 2 | Heading 2 | |
| Bold | **bold text** | bold text | |
| Italic | *italic text* | italic text | |
| StrikethroughGFM | ~~removed text~~ | ||
| Link | [ilovemd](https://ilovemd.net) | ilovemd | |
| Image |  | image with alt text | |
| Bullet list | - First item | • First item | |
| Numbered list | 1. First step | 1. First step | |
| Task listGFM | - [ ] Draft article | ☐ Draft article | |
| Blockquote | > Quoted text | Quoted text | |
| Inline code | `npm run build` | npm run build | |
| Fenced code | ```js
console.log("Hi");
``` | code block | |
| TableGFM | | A | B |
|---|---|
| 1 | 2 | | two-column table | |
| Horizontal rule | --- | divider line | |
| Hard line break | Line one
Line two | two lines | |
| Escaped character | \*not italic\* | *not italic* |
Headings
Use headings to describe hierarchy, not simply to make text larger. Start with one H1, use H2 for main sections, and H3 for subsections.
# Project Guide
## Installation
### macOS
### WindowsBold, italic, and strikethrough
Use emphasis to clarify meaning. Avoid making entire paragraphs bold; short phrases are easier to scan.
**Important text**
*Emphasized text*
***Bold and italic***
~~Removed text~~Lists and task lists
Use hyphens for unordered lists and numbers for ordered steps. Task lists are a GitHub Flavored Markdown extension.
1. Install the package
2. Update the configuration
3. Run the build
- [x] Write the draft
- [ ] Review the links
- [ ] Publish the pageLinks and images
Write link text that explains the destination. Give every image useful alternative text.
Read the [Markdown to PDF guide](/blog/markdown-to-pdf-guide).
Inline code and code blocks
Use single backticks for commands and filenames. Fence multiple lines with three backticks and add a language when highlighting matters.
Run `npm run build` before deployment.
```javascript
const message = "Hello, Markdown";
console.log(message);
```Tables and alignment
Keep table cells short. Add colons to the separator row for left, center, or right alignment.
| Format | Editable | Best for |
| :--- | :---: | ---: |
| DOCX | Yes | Collaboration |
| PDF | No | Sharing |
| HTML | Yes | Publishing |Open the Markdown table generator Line breaks and escaped characters
A normal line ending may stay inside the same paragraph. Add two spaces before the line ending or use a blank line when you need a deliberate break. Add a backslash before punctuation when it should display literally.
First line with a hard break.
Second line.
New paragraph.
\*This shows literal asterisks.\*CommonMark vs GitHub Flavored Markdown
Markdown implementations share a core, but extensions are not universal. Check the destination before relying on platform-specific syntax.
Headings, paragraphs, emphasis, blockquotes, lists, code, links, images, and thematic breaks form the portable core used by CommonMark-compatible parsers.
GitHub Flavored Markdown adds tables, task list items, strikethrough, and extended autolinks. Other editors may support all, some, or none of these features.
For exact parsing rules, use the CommonMark specification and the GitHub Flavored Markdown specification.
Common Markdown mistakes
If formatting does not render as expected, check structure before changing tools.
- Leave a blank line before lists, tables, and fenced code blocks.
- Close every emphasis marker and code fence.
- Add a separator row beneath table headers.
- Use consistent spaces for nested lists.
- Confirm whether the destination supports GFM extensions.
- Use stable image URLs with meaningful alt text.
Markdown cheat sheet FAQs
What is the most common Markdown syntax?
The most common syntax includes headings with #, bold text with **, italic text with *, lists with - or numbers, links with square brackets and parentheses, and code with backticks.
Is Markdown the same everywhere?
Core syntax is broadly consistent, but extensions differ. Tables, task lists, footnotes, and strikethrough may work in GitHub Flavored Markdown while behaving differently in another editor.
How do I preview Markdown?
Paste or type the source into a Markdown editor with a rendered preview. The preview should show formatted headings, lists, links, tables, quotes, and code rather than displaying the Markdown symbols again.
Can Markdown create tables?
Yes. Many Markdown implementations support pipe tables through extensions such as GitHub Flavored Markdown. Complex merged cells and multi-line layouts are better handled in HTML or a spreadsheet.
Can I convert Markdown to PDF or Word?
Yes. Markdown structure can be rendered as a fixed PDF or converted into an editable DOCX file. Review tables, images, code wrapping, and page breaks before sharing the final document.
