The complete markdown syntax guide with examples. Master markdown formatting from basic text to advanced tables, code blocks, and more.
Markdown is a lightweight markup language created by John Gruber in 2004. It's designed to be easy to read and write, converting plain text into formatted HTML. Today, markdown syntax is used everywhereβfrom GitHub READMEs to documentation, blogs, forums, and note-taking apps.
The beauty of markdown formatting is its simplicity. Unlike HTML, which requires
opening and closing tags, markdown uses intuitive symbols. For example, wrapping text
in asterisks makes it bold (**bold**), and using hash symbols creates headings
(# Heading).
Create headings by starting a line with hash symbols (#). The number of hashes determines
the heading level. Markdown supports six heading levels, from # H1 to
###### H6.
For H1 and H2, you can also use underlines:
Markdown bold, italic, and other text formatting is easy to apply. Here's the complete guide to markdown text formatting:
| Format | Markdown Syntax | Result |
|---|---|---|
| Bold | **bold text** or __bold__ |
bold text |
| Italic | *italic text* or _italic_ |
italic text |
| Bold & Italic | ***bold and italic*** |
bold and italic |
~~strikethrough~~ |
||
Inline Code |
`code` |
code |
To make text bold in markdown, wrap it with double asterisks or double underscores:
For italic markdown text, use single asterisks or single underscores:
Strikethrough markdown uses double tildes. This is great for showing deleted or outdated content:
Creating a markdown link is straightforward. Links in markdown follow
the pattern: [link text](URL). Here's everything you need to know about markdown
linking.
The basic link in markdown format is:
[Link Text](URL) β Basic link[Link Text](URL "Title") β Link with hover tooltip[Link Text](#section-id) β Internal anchor link<https://auto-link.com> β Auto-linked URLFor documents with many links, use reference-style markdown hyperlinks:
Markdown images work similarly to links, but with an exclamation mark prefix. The
syntax for markdown with images is: .
To make an image clickable, wrap it in link syntax:
Markdown lists come in two flavors: ordered (numbered) and unordered (bulleted). Lists in markdown are essential for organizing content.
Create list markdown items with dashes, asterisks, or plus signs:
For numbered markdown lists, use numbers followed by periods:
Indent with spaces or tabs for nested lists markdown:
Create blockquotes with the greater-than symbol (>):
This is a blockquote.
It can span multiple paragraphs.
Markdown code blocks are essential for technical documentation. There are two types: inline code and fenced code blocks markdown.
Wrap code with single backticks:
For multi-line markdown code block syntax, use triple backticks with an optional language:
Common language identifiers for syntax highlighting in code blocks markdown:
javascript, js |
python, py |
html |
css |
java |
csharp, c# |
cpp, c++ |
go |
rust |
ruby |
php |
sql |
bash, shell |
json |
yaml |
markdown, md |
Markdown tables use pipes and dashes to create structured data. Table markdown is one of the most useful features for organizing information. Learn how to create tables in markdown below.
A table in markdown requires headers, a separator row, and data rows:
| Header 1 | Header 2 | Header 3 |
|---|---|---|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
Control column alignment in tables markdown using colons:
:--- β Left align (default):---: β Center align---: β Right alignCreate horizontal dividers with three or more dashes, asterisks, or underscores:
All three produce the same horizontal line.
Markdown checkboxes create interactive task lists. This is a GitHub Flavored Markdown (GFM) extension for markdown checkbox items.
βοΈ Completed task
βοΈ Another done item
β Incomplete task
β Todo item
Use - [x] for checked checkboxes in markdown and - [ ] for
unchecked items.
Understanding markdown line break behavior is important. By default, single line breaks are ignored. Here's how to handle line break in markdown:
\ at the end of a line<br> for explicit breaks
To display literal markdown characters, escape them with a backslash (\):
\ ` * _ { } [
] ( ) # + - .
! |
GitHub Flavored Markdown (GFM) and other implementations add these extended features to standard markdown syntax:
| Feature | Syntax | Description |
|---|---|---|
| Footnotes | Text[^1] ... [^1]: Note |
Reference notes at bottom |
| Definition Lists | Term: Definition |
Term/definition pairs |
| Highlight | ==highlighted== |
Highlighted text |
| Subscript | H~2~O |
HβO |
| Superscript | X^2^ |
XΒ² |
| Emoji | :smile: |
π (on supported platforms) |
| Auto-links | https://example.com |
Automatic URL linking |
Comment markdown content that won't render using HTML syntax:
Complete markdown cheat sheet quick reference table:
| Element | Syntax |
|---|---|
| Heading | # H1 through ###### H6 |
| Bold | **text** |
| Italic | *text* |
| Strikethrough | ~~text~~ |
| Link | [text](url) |
| Image |  |
| Code | `code` |
| Code Block | ```lang ... ``` |
| Blockquote | > quote |
| Unordered List | - item |
| Ordered List | 1. item |
| Task List | - [x] done |
| Table | | col | col | |
| Horizontal Rule | --- |
| Line Break | Two spaces + Enter |
Try out everything from this markdown cheat sheet in our free online editor with live preview.
Open Markdown Viewer β