What is Markdown?
Markdown is a lightweight markup language created by John Gruber in 2004. It lets you format plain text using simple, intuitive syntax that converts to HTML. Instead of writing raw HTML tags like <strong> and <em>, you use characters like ** and * to indicate bold and italic text.
Markdown has become the standard writing format for developers, technical writers, and content creators. You encounter it on GitHub for README files and pull requests, on Reddit and Stack Overflow for comments, in Notion and Obsidian for note-taking, in static site generators like Jekyll and Hugo, and in countless documentation systems. Learning Markdown once means you can write formatted content almost anywhere.
The beauty of Markdown is that even the raw source text is readable. Unlike HTML, which is cluttered with angle brackets and closing tags, a Markdown document looks clean and natural. This makes it ideal for version control, collaboration, and long-term content storage.
Basic Syntax
The following elements are part of the original Markdown specification created by John Gruber. They are supported everywhere Markdown is used.
Headings
Create headings by placing one to six # symbols before your heading text. The number of hash signs determines the heading level. Always put a space between the # and the text.
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
This produces six levels of headings, from the largest <h1> down to the smallest <h6>. In practice, most documents use only heading levels 1 through 3. Use heading level 1 for the document title, level 2 for major sections, and level 3 for subsections.
There is also an alternative syntax for heading levels 1 and 2, using underlines:
Heading 1
=========
Heading 2
---------
Both styles produce identical HTML output. The # style is more commonly used because it supports all six levels and is easier to type.
Paragraphs and Line Breaks
Paragraphs are created by separating blocks of text with one or more blank lines. Simply pressing Enter once does not create a new paragraph in Markdown.
This is the first paragraph. It can span
multiple lines in the source file.
This is the second paragraph. The blank
line above separates it from the first.
To create a line break within the same paragraph (a <br> tag), end a line with two or more spaces, then press Enter. Alternatively, some Markdown processors support a trailing backslash for line breaks:
This is the first line.
This is the second line (same paragraph).
This is the first line.\
This is the second line (backslash method).
Bold, Italic, and Strikethrough
Markdown provides simple syntax for emphasizing text. You can nest these styles to combine them.
Bold text is wrapped in double asterisks or double underscores:
**This text is bold**
__This is also bold__
Italic text is wrapped in single asterisks or single underscores:
*This text is italic*
_This is also italic_
Bold and italic combined uses triple asterisks or triple underscores:
***This text is bold and italic***
___This is also bold and italic___
Strikethrough text is wrapped in double tildes:
~~This text has a strikethrough~~
The strikethrough renders as text with a horizontal line through the middle, indicating deleted or deprecated content. This is technically part of the extended syntax (GitHub Flavored Markdown) but is so widely supported that it belongs in every cheat sheet.
Best practice: prefer asterisks (*) over underscores (_) for bold and italic. Asterisks work reliably in the middle of words, while underscores can behave unpredictably inside words on some processors.
Links
Links are created using square brackets for the display text followed by parentheses for the URL:
[ToolPilot](https://gotoolpilot.com)
[Google](https://google.com "Google's Homepage")
The first example renders as a clickable link with the text "ToolPilot" pointing to the URL. The second example adds an optional title attribute that appears as a tooltip on hover.
You can also create reference-style links, which are useful when the same URL appears multiple times in a document:
Visit [ToolPilot][1] for free online tools.
Check out our [Markdown Preview][md-tool] tool.
[1]: https://gotoolpilot.com
[md-tool]: https://gotoolpilot.com/tools/markdown-preview
Reference links keep your Markdown source clean by moving URLs to the bottom of the document.
To turn a raw URL into a clickable link, wrap it in angle brackets:
<https://gotoolpilot.com>
<[email protected]>
Images
Images use the same syntax as links but with an exclamation mark at the beginning:


The text inside the square brackets becomes the image's alt text, which is important for accessibility and SEO. The optional title in quotes appears as a tooltip on hover. Markdown does not provide built-in syntax for setting image width or height, so you may need to fall back to HTML <img> tags if you need to control dimensions.
Extended Syntax
These elements extend the original Markdown specification. They are supported by most modern Markdown processors, including GitHub Flavored Markdown (GFM), which is the most widely used variant.
Inline Code
Wrap text in single backticks to display it as inline code. This renders in a monospace font with a subtle background, making it stand out from regular text:
Use the `console.log()` function to debug.
The `<div>` element is a block container.
Inline code is perfect for referencing variable names, function calls, HTML tags, file names, terminal commands, and any other short code snippets within a paragraph.
If your code itself contains backticks, use double backticks to wrap it:
``Use `backticks` inside code spans.``
Fenced Code Blocks
For multi-line code, use three backticks (or three tildes) before and after the code. Add a language identifier after the opening backticks to enable syntax highlighting:
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet('World'));
```
```python
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
```
```css
.container {
display: flex;
justify-content: center;
align-items: center;
}
```
Common language identifiers include javascript (or js), python, html, css, bash, json, sql, java, c, cpp, ruby, go, rust, and typescript. The syntax highlighting depends on the platform or renderer you are using.
Blockquotes
Create blockquotes by placing a > symbol before each line. Blockquotes can contain multiple paragraphs, nested quotes, and other Markdown elements:
> This is a blockquote. It is typically rendered
> with a vertical bar on the left side.
>
> This is a second paragraph in the same blockquote.
> Blockquotes can be nested.
>
> > This is a nested blockquote.
> > It goes one level deeper.
Blockquotes are commonly used for quoting external sources, highlighting important notes, and displaying email-style replies.
Ordered Lists
Ordered lists use numbers followed by a period and a space. The actual numbers you use do not matter; Markdown will number them sequentially in the output:
1. First item
2. Second item
3. Third item
1. First item
1. Second item
1. Third item
Both examples above produce the same numbered list (1, 2, 3). Many writers use 1. for every item so they can reorder items without renumbering. Ordered lists render as <ol> elements in HTML.
Unordered Lists
Unordered lists use a dash (-), asterisk (*), or plus sign (+) followed by a space:
- First item
- Second item
- Third item
* First item
* Second item
* Third item
All three markers produce identical bullet-point lists. Pick one style and use it consistently throughout your document. Most Markdown style guides recommend dashes (-).
Nested Lists
Indent list items with two or four spaces (depending on the processor) to create nested lists. You can mix ordered and unordered lists:
- Frontend
- HTML
- CSS
- JavaScript
- React
- Vue
- Backend
- Python
- Node.js
1. Getting started
1. Install dependencies
2. Configure settings
2. Development
- Write code
- Run tests
3. Deployment
Nested lists are essential for organizing hierarchical content like outlines, navigation structures, and categorized information.
Tables
Create tables using pipes (|) to separate columns and hyphens (-) for the header row separator. Use colons for column alignment:
| Feature | Syntax | Renders As |
|------------|----------------|------------------|
| Bold | `**text**` | **text** |
| Italic | `*text*` | *text* |
| Code | `` `code` `` | `code` |
| Link | `[text](url)` | [text](url) |
Control column alignment with colons in the separator row:
| Left Aligned | Center Aligned | Right Aligned |
|:-------------|:--------------:|--------------:|
| Left | Center | Right |
| Text | Text | Text |
A colon on the left means left-aligned (default), colons on both sides means centered, and a colon on the right means right-aligned. Tables do not need to be perfectly aligned in the source, but aligning them makes your Markdown more readable.
Task Lists
Create interactive checklists using square brackets with a space (unchecked) or an x (checked):
- [x] Write the introduction
- [x] Add code examples
- [ ] Review for typos
- [ ] Publish the article
Task lists render as checkboxes on platforms like GitHub, making them ideal for tracking progress in issues, pull requests, and project documentation. On GitHub, you can click the checkboxes to toggle them directly.
Horizontal Rules
Create a horizontal line (thematic break) using three or more hyphens, asterisks, or underscores on a line by themselves:
---
***
___
All three produce an identical <hr> element. Horizontal rules are useful for separating distinct sections within a document. Use them sparingly to avoid visual clutter.
Tips and Best Practices
When to Use Markdown vs. HTML
Markdown is ideal for content-focused writing: documentation, blog posts, README files, notes, comments, and any text where readability of the source matters. Use Markdown when your content is primarily text with standard formatting needs.
Switch to HTML when you need precise control over layout, custom styling, or elements Markdown does not support, such as image dimensions, colored text, collapsible sections, or complex multi-column layouts. Most Markdown processors allow inline HTML, so you can mix both in the same document when needed.
Common Mistakes to Avoid
- Missing blank lines: Always put a blank line before and after headings, lists, code blocks, and blockquotes. Without blank lines, some Markdown processors will not render these elements correctly.
- Forgetting the space after heading markers: Write
# Heading, not#Heading. The space is required for the heading to be recognized. - Inconsistent list markers: Mixing
-,*, and+in the same list can cause rendering issues on some platforms. Stick to one marker style per list. - Incorrect nesting indentation: Nested list items must be indented consistently. Most processors expect 2 or 4 spaces. Inconsistent indentation breaks the nesting structure.
- Not escaping special characters: If you need to display literal Markdown characters like
*,#, or[, precede them with a backslash:\*,\#,\[. - Using tabs inconsistently: Some processors handle tabs differently. Prefer spaces for indentation to ensure consistent rendering across platforms.
Where Markdown Is Supported
Markdown is supported on a remarkably wide range of platforms:
- Code hosting: GitHub, GitLab, Bitbucket (README files, issues, pull requests, wikis)
- Community platforms: Reddit, Stack Overflow, Discord, Slack
- Note-taking apps: Notion, Obsidian, Bear, Joplin, Typora
- Documentation tools: Docusaurus, MkDocs, Read the Docs, GitBook, Confluence
- Static site generators: Jekyll, Hugo, Gatsby, Next.js, Astro
- Content management: WordPress (with plugins), Ghost, DEV.to, Hashnode, Medium (partial)
- Messaging and email: Many email clients and messaging platforms support Markdown or a subset of it
Each platform may support slightly different Markdown features. GitHub Flavored Markdown (GFM) is the most common extended variant, adding tables, task lists, strikethrough, and autolinked URLs on top of the original specification.
Quick Reference Table
Here is a compact summary of every syntax element covered in this guide:
| Element | Markdown Syntax |
|---|---|
| Heading | # H1 through ###### H6 |
| Bold | **bold text** |
| Italic | *italic text* |
| Bold + Italic | ***bold italic*** |
| Strikethrough | ~~strikethrough~~ |
| Link | [text](url) |
| Image |  |
| Inline Code | `code` |
| Code Block | ```lang ... ``` |
| Blockquote | > quoted text |
| Ordered List | 1. item |
| Unordered List | - item |
| Table | | col | col | |
| Task List | - [x] done / - [ ] todo |
| Horizontal Rule | --- |
Conclusion
Markdown is one of the most valuable skills you can learn as a developer or writer. Its simplicity makes it fast to write, its plain-text nature makes it future-proof, and its universal support means you can use it virtually everywhere. Bookmark this cheat sheet and refer back to it whenever you need a quick syntax refresher.
Whether you are writing a GitHub README, drafting documentation, taking notes in Obsidian, or formatting a Reddit comment, the syntax covered in this guide has you covered. Start with the basics, gradually incorporate extended syntax as you need it, and you will be writing Markdown fluently in no time.