<!DOCTYPE html>
<html lang="en">
<head>
<script defer data-domain="markdownguide.org" src="https://hawk.forklabs.com/js/plausible.js"></script>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/>
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicons/apple-touch-icon.png">
<link rel="mask-icon" href="/assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Basic Syntax | Markdown Guide</title>
<meta name="description" content="The Markdown elements outlined in the original design document.">
<meta name="twitter:card" content="summary" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://www.markdownguide.org/basic-syntax/" />
<meta property="og:title" content="Basic Syntax | Markdown Guide" />
<meta property="og:description" content="The Markdown elements outlined in the original design document." />
<meta property="og:image" content="https://www.markdownguide.org/assets/images/markdown-guide-og.jpg" />
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<link href="/assets/css/pagebundle.css" rel="stylesheet">
<link rel="canonical" href="https://www.markdownguide.org/basic-syntax/">
<script src="/assets/javascript/jquery-3.5.1.slim.min.js"></script>
<script async src="/assets/javascript/bs.bundle.min.js"></script>
<script defer src="/assets/javascript/fa.bundle.min.js"></script>
<script async src="https://media.ethicalads.io/media/client/ethicalads.min.js"></script>
</head>
<body data-spy="scroll" data-target="#toc">
<a id="jotbird-banner" class="jotbird-banner" href="https://www.jotbird.com" target="_blank" rel="noopener noreferrer">
<div class="container jotbird-banner__inner">
<img src="https://assets.jotbird.com/logo-black-white(2).svg" alt="JotBird" class="jotbird-banner__logo">
<span class="jotbird-banner__text">Introducing JotBird — instantly publish Markdown as a shareable web page. ✨</span>
<button class="jotbird-banner__close" type="button" aria-label="Dismiss announcement">×</button>
</div>
</a>
<script>
document.addEventListener('DOMContentLoaded', function () {
var banner = document.getElementById('jotbird-banner');
if (!banner || !window.localStorage) return;
if (localStorage.getItem('hideJotbirdBanner') === '1') {
banner.style.display = 'none';
return;
}
var closeBtn = banner.querySelector('.jotbird-banner__close');
if (!closeBtn) return;
closeBtn.addEventListener('click', function (event) {
event.preventDefault();
event.stopPropagation();
banner.style.display = 'none';
localStorage.setItem('hideJotbirdBanner', '1');
});
});
</script>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark mdg-nav">
<div class="container">
<a class="navbar-brand" href="/" style="margin-top: 2px; margin-bottom: 3px">
<img src="/assets/images/markdown-mark-white.svg" height="23" width="47" class="d-inline-block align-top" alt="Markdown Guide" style="margin-top: 4px; padding-right: 10px">
Markdown Guide
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup" style="margin-top: 2px">
<div class="navbar-nav">
<a class="nav-item nav-link " href="/getting-started/">Get Started</a>
<a class="nav-item nav-link " href="/cheat-sheet/">Cheat Sheet</a>
<a class="nav-item nav-link active" href="/basic-syntax/">Basic Syntax</a>
<a class="nav-item nav-link " href="/extended-syntax/">Extended Syntax</a>
<a class="nav-item nav-link " href="/hacks/">Hacks</a>
<a class="nav-item nav-link " href="/tools/">Tools</a>
<a class="nav-item nav-link " href="/book/">Book</a>
</div>
<div class="ml-auto mt-3 mt-lg-0">
<div id="docsearch"></div>
</div>
</div>
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1 class="no-anchor" data-toc-skip>Basic Syntax</h1>
<p>The Markdown elements outlined in the original design document.</p>
</div>
</div>
<div class="container">
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-12 col-md-9">
<h2>Overview</h2>
<p>Nearly all Markdown applications support the basic syntax outlined in the original Markdown design document. There are minor variations and discrepancies between Markdown processors — those are noted inline wherever possible.</p>
<h2>Headings</h2>
<p>To create a heading, add number signs (<code class="language-plaintext highlighter-rouge">#</code>) in front of a word or phrase. The number of number signs you use should correspond to the heading level. For example, to create a heading level three (<code class="language-plaintext highlighter-rouge"><h3></code>), use three number signs (e.g., <code class="language-plaintext highlighter-rouge">### My Header</code>).</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge"># Heading level 1</code></td>
<td><code class="highlighter-rouge"><h1>Heading level 1</h1></code></td>
<td><h1 class="no-anchor" data-toc-skip="">Heading level 1</h1></td>
</tr>
<tr>
<td><code class="highlighter-rouge">## Heading level 2</code></td>
<td><code class="highlighter-rouge"><h2>Heading level 2</h2></code></td>
<td><h2 class="no-anchor" data-toc-skip="">Heading level 2</h2></td>
</tr>
<tr>
<td><code class="highlighter-rouge">### Heading level 3</code></td>
<td><code class="highlighter-rouge"><h3>Heading level 3</h3></code></td>
<td><h3 class="no-anchor" data-toc-skip="">Heading level 3</h3></td>
</tr>
<tr>
<td><code class="highlighter-rouge">#### Heading level 4</code></td>
<td><code class="highlighter-rouge"><h4>Heading level 4</h4></code></td>
<td><h4 class="no-anchor">Heading level 4</h4></td>
</tr>
<tr>
<td><code class="highlighter-rouge">##### Heading level 5</code></td>
<td><code class="highlighter-rouge"><h5>Heading level 5</h5></code></td>
<td><h5 class="no-anchor">Heading level 5</h5></td>
</tr>
<tr>
<td><code class="highlighter-rouge">###### Heading level 6</code></td>
<td><code class="highlighter-rouge"><h6>Heading level 6</h6></code></td>
<td><h6 class="no-anchor">Heading level 6</h6></td>
</tr>
</tbody>
</table>
<h3 id="alternate-syntax">Alternate Syntax</h3>
<p>Alternatively, on the line below the text, add any number of <code class="language-plaintext highlighter-rouge">==</code> characters for heading level 1 or <code class="language-plaintext highlighter-rouge">--</code> characters for heading level 2.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">Heading level 1<br />===============</code></td>
<td><code class="highlighter-rouge"><h1>Heading level 1</h1></code></td>
<td><h1 class="no-anchor" data-toc-skip="">Heading level 1</h1></td>
</tr>
<tr>
<td><code class="highlighter-rouge">Heading level 2<br />---------------</code></td>
<td><code class="highlighter-rouge"><h2>Heading level 2</h2></code></td>
<td><h2 class="no-anchor" data-toc-skip="">Heading level 2</h2></td>
</tr>
</tbody>
</table>
<h3 id="heading-best-practices">Heading Best Practices</h3>
<p>Markdown applications don’t agree on how to handle a missing space between the number signs (<code class="language-plaintext highlighter-rouge">#</code>) and the heading name. For compatibility, always put a space between the number signs and the heading name.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
# Here's a Heading<br /><br />
</code>
</td>
<td>
<code class="highlighter-rouge">
#Here's a Heading
</code>
</td>
</tr>
</tbody>
</table>
<p>You should also put blank lines before and after a heading for compatibility.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
Try to put a blank line before...<br /><br />
# Heading<br /><br />
...and after a heading.
</code>
</td>
<td>
<code class="highlighter-rouge">
Without blank lines, this might not look right.<br />
# Heading<br />
Don't do this!
</code>
</td>
</tr>
</tbody>
</table>
<h2>Paragraphs</h2>
<p>To create paragraphs, use a blank line to separate one or more lines of text.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
I really like using Markdown.<br /><br />
I think I'll use it to format all of my documents from now on.
</code>
</td>
<td>
<code class="highlighter-rouge"><p>I really like using Markdown.</p><br /><br />
<p>I think I'll use it to format all of my documents from now on.</p></code>
</td>
<td>
<p>I really like using Markdown.</p>
<p>I think I'll use it to format all of my documents from now on.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="paragraph-best-practices">Paragraph Best Practices</h3>
<p>Unless the <a href="/basic-syntax/#paragraphs">paragraph is in a list</a>, don’t indent paragraphs with spaces or tabs.</p>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <strong>Note:</strong> If you need to indent paragraphs in the output, see the section on how to <a href="/hacks/#indent-tab">indent (tab)</a>.
</div>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
Don't put tabs or spaces in front of your paragraphs.<br /><br />
Keep lines left-aligned like this.<br /><br />
</code>
</td>
<td>
<code class="highlighter-rouge">
This can result in unexpected
formatting problems.<br /><br />
Don't add tabs or spaces in front of paragraphs.
</code>
</td>
</tr>
</tbody>
</table>
<h2>Line Breaks</h2>
<p>To create a line break or new line (<code class="language-plaintext highlighter-rouge"><br></code>), end a line with two or more spaces, and then type return.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
This is the first line. <br />
And this is the second line.
</code>
</td>
<td>
<code class="highlighter-rouge"><p>This is the first line.<br><br />
And this is the second line.</p></code>
</td>
<td>
<p>This is the first line.<br />
And this is the second line.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="line-break-best-practices">Line Break Best Practices</h3>
<p>You can use two or more spaces (commonly referred to as “trailing whitespace”) for line breaks in nearly every Markdown application, but it’s controversial. It’s hard to see trailing whitespace in an editor, and many people accidentally or intentionally put two spaces after every sentence. For this reason, you may want to use something other than trailing whitespace for line breaks. If your Markdown application <a href="/basic-syntax/#html">supports HTML</a>, you can use the <code class="language-plaintext highlighter-rouge"><br></code> HTML tag.</p>
<p>For compatibility, use trailing white space or the <code class="language-plaintext highlighter-rouge"><br></code> HTML tag at the end of the line.</p>
<p>There are two other options I don’t recommend using. CommonMark and a few other lightweight markup languages let you type a backslash (<code class="language-plaintext highlighter-rouge">\</code>) at the end of the line, but not all Markdown applications support this, so it isn’t a great option from a compatibility perspective. And at least a couple lightweight markup languages don’t require anything at the end of the line — just type return and they’ll create a line break.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
First line with two spaces after. <br />
And the next line.<br /><br />
First line with the HTML tag after.<br><br />
And the next line.<br /><br />
</code>
</td>
<td>
<code class="highlighter-rouge">
First line with a backslash after.\<br />
And the next line.<br /><br />
First line with nothing after.<br />
And the next line.<br /><br />
</code>
</td>
</tr>
</tbody>
</table>
<h2>Emphasis</h2>
<p>You can add emphasis by making text bold or italic.</p>
<h3 id="bold">Bold</h3>
<p>To bold text, add two asterisks or underscores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">I just love **bold text**.</code></td>
<td><code class="highlighter-rouge">I just love <strong>bold text</strong>.</code></td>
<td>I just love <strong>bold text</strong>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">I just love __bold text__.</code></td>
<td><code class="highlighter-rouge">I just love <strong>bold text</strong>.</code></td>
<td>I just love <strong>bold text</strong>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">Love**is**bold</code></td> <td><code class="highlighter-rouge">Love<strong>is</strong>bold</code></td>
<td>Love<strong>is</strong>bold</td>
</tr>
</tbody>
</table>
<h4 id="bold-best-practices">Bold Best Practices</h4>
<p>Markdown applications don’t agree on how to handle underscores in the middle of a word. For compatibility, use asterisks to bold the middle of a word for emphasis.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
Love**is**bold
</code>
</td>
<td>
<code class="highlighter-rouge">
Love__is__bold
</code>
</td>
</tr>
</tbody>
</table>
<h3 id="italic">Italic</h3>
<p>To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for emphasis, add one asterisk without spaces around the letters.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">Italicized text is the *cat's meow*.</code></td>
<td><code class="highlighter-rouge">Italicized text is the <em>cat's meow</em>.</code></td>
<td>Italicized text is the <em>cat’s meow</em>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">Italicized text is the _cat's meow_.</code></td>
<td><code class="highlighter-rouge">Italicized text is the <em>cat's meow</em>.</code></td>
<td>Italicized text is the <em>cat’s meow</em>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">A*cat*meow</code></td>
<td><code class="highlighter-rouge">A<em>cat</em>meow</code></td>
<td>A<em>cat</em>meow</td>
</tr>
</tbody>
</table>
<h4 id="italic-best-practices">Italic Best Practices</h4>
<p>Markdown applications don’t agree on how to handle underscores in the middle of a word. For compatibility, use asterisks to italicize the middle of a word for emphasis.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
A*cat*meow
</code>
</td>
<td>
<code class="highlighter-rouge">
A_cat_meow
</code>
</td>
</tr>
</tbody>
</table>
<h3 id="bold-and-italic">Bold and Italic</h3>
<p>To emphasize text with bold and italics at the same time, add three asterisks or underscores before and after a word or phrase. To bold and italicize the middle of a word for emphasis, add three asterisks without spaces around the letters.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">This text is ***really important***.</code></td>
<td><code class="highlighter-rouge">This text is <em><strong>really important</strong></em>.</code></td>
<td>This text is <em><strong>really important</strong></em>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">This text is ___really important___.</code></td>
<td><code class="highlighter-rouge">This text is <em><strong>really important</strong></em>.</code></td>
<td>This text is <em><strong>really important</strong></em>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">This text is __*really important*__.</code></td>
<td><code class="highlighter-rouge">This text is <em><strong>really important</strong></em>.</code></td>
<td>This text is <em><strong>really important</strong></em>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">This text is **_really important_**.</code></td>
<td><code class="highlighter-rouge">This text is <em><strong>really important</strong></em>.</code></td>
<td>This text is <em><strong>really important</strong></em>.</td>
</tr>
<tr>
<td><code class="highlighter-rouge">This is really***very***important text.</code></td>
<td><code class="highlighter-rouge">This is really<em><strong>very</strong></em>important text.</code></td>
<td>This is really<em><strong>very</strong></em>important text.</td>
</tr>
</tbody>
</table>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <strong>Note:</strong> The order of the <code>em</code> and <code>strong</code> tags might be reversed depending on the Markdown processor you're using.
</div>
<h4 id="bold-and-italic-best-practices">Bold and Italic Best Practices</h4>
<p>Markdown applications don’t agree on how to handle underscores in the middle of a word. For compatibility, use asterisks to bold and italicize the middle of a word for emphasis.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
This is really***very***important text.
</code>
</td>
<td>
<code class="highlighter-rouge">
This is really___very___important text.
</code>
</td>
</tr>
</tbody>
</table>
<h2>Blockquotes</h2>
<p>To create a blockquote, add a <code class="language-plaintext highlighter-rouge">></code> in front of a paragraph.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>> Dorothy followed her through many of the beautiful rooms in her castle.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<blockquote>
<p>Dorothy followed her through many of the beautiful rooms in her castle.</p>
</blockquote>
<h3 id="blockquotes-with-multiple-paragraphs">Blockquotes with Multiple Paragraphs</h3>
<p>Blockquotes can contain multiple paragraphs. Add a <code class="language-plaintext highlighter-rouge">></code> on the blank lines between the paragraphs.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<blockquote>
<p>Dorothy followed her through many of the beautiful rooms in her castle.</p>
<p>The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.</p>
</blockquote>
<h3 id="nested-blockquotes">Nested Blockquotes</h3>
<p>Blockquotes can be nested. Add a <code class="language-plaintext highlighter-rouge">>></code> in front of the paragraph you want to nest.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>> Dorothy followed her through many of the beautiful rooms in her castle.
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<blockquote>
<p>Dorothy followed her through many of the beautiful rooms in her castle.</p>
<blockquote>
<p>The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.</p>
</blockquote>
</blockquote>
<h3 id="blockquotes-with-other-elements">Blockquotes with Other Elements</h3>
<p>Blockquotes can contain other Markdown formatted elements. Not all elements can be used — you’ll need to experiment to see which ones work.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>> #### The quarterly results look great!
>
> - Revenue was off the chart.
> - Profits were higher than ever.
>
> *Everything* is going according to **plan**.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<blockquote>
<h4 class="no-anchor">The quarterly results look great!</h4>
<ul>
<li>Revenue was off the chart.</li>
<li>Profits were higher than ever.</li>
</ul>
<p><em>Everything</em> is going according to <strong>plan</strong>.</p>
</blockquote>
<h3 id="blockquotes-best-practices">Blockquotes Best Practices</h3>
<p>For compatibility, put blank lines before and after blockquotes.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
Try to put a blank line before...<br /><br />
> This is a blockquote<br /><br />
...and after a blockquote.
</code>
</td>
<td>
<code class="highlighter-rouge">
Without blank lines, this might not look right.<br />
> This is a blockquote<br />
Don't do this!
</code>
</td>
</tr>
</tbody>
</table>
<h2>Lists</h2>
<p>You can organize items into ordered and unordered lists.</p>
<h3 id="ordered-lists">Ordered Lists</h3>
<p>To create an ordered list, add line items with numbers followed by periods. The numbers don’t have to be in numerical order, but the list should start with the number one.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
1. First item<br />
2. Second item<br />
3. Third item<br />
4. Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ol><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item</li><br />
<li>Fourth item</li><br />
</ol>
</code>
</td>
<td>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
</td>
</tr>
<tr>
<td>
<code class="highlighter-rouge">
1. First item<br />
1. Second item<br />
1. Third item<br />
1. Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ol><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item</li><br />
<li>Fourth item</li><br />
</ol>
</code>
</td>
<td>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
</td>
</tr>
<tr>
<td>
<code class="highlighter-rouge">
1. First item<br />
8. Second item<br />
3. Third item<br />
5. Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ol><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item</li><br />
<li>Fourth item</li><br />
</ol>
</code>
</td>
<td>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ol>
</td>
</tr>
<tr>
<td>
<code class="highlighter-rouge">
1. First item<br />
2. Second item<br />
3. Third item<br />
1. Indented item<br />
2. Indented item<br />
4. Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ol><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item<br />
<ol><br />
<li>Indented item</li><br />
<li>Indented item</li><br />
</ol><br />
</li><br />
<li>Fourth item</li><br />
</ol>
</code>
</td>
<td>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ol>
<li>Indented item</li>
<li>Indented item</li>
</ol>
</li>
<li>Fourth item</li>
</ol>
</td>
</tr>
</tbody>
</table>
<h4 id="ordered-list-best-practices">Ordered List Best Practices</h4>
<p>CommonMark and a few other lightweight markup languages let you use a parenthesis (<code class="language-plaintext highlighter-rouge">)</code>) as a delimiter (e.g., <code class="language-plaintext highlighter-rouge">1) First item</code>), but not all Markdown applications support this, so it isn’t a great option from a compatibility perspective. For compatibility, use periods only.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
1. First item<br />
2. Second item
</code>
</td>
<td>
<code class="highlighter-rouge">
1) First item<br />
2) Second item
</code>
</td>
</tr>
</tbody>
</table>
<h3 id="unordered-lists">Unordered Lists</h3>
<p>To create an unordered list, add dashes (<code class="language-plaintext highlighter-rouge">-</code>), asterisks (<code class="language-plaintext highlighter-rouge">*</code>), or plus signs (<code class="language-plaintext highlighter-rouge">+</code>) in front of line items. Indent one or more items to create a nested list.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
- First item<br />
- Second item<br />
- Third item<br />
- Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ul><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item</li><br />
<li>Fourth item</li><br />
</ul>
</code>
</td>
<td>
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
</td>
</tr>
<tr>
<td>
<code class="highlighter-rouge">
* First item<br />
* Second item<br />
* Third item<br />
* Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ul><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item</li><br />
<li>Fourth item</li><br />
</ul>
</code>
</td>
<td>
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
</td>
</tr>
<tr>
<td>
<code class="highlighter-rouge">
+ First item<br />
+ Second item<br />
+ Third item<br />
+ Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ul><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item</li><br />
<li>Fourth item</li><br />
</ul>
</code>
</td>
<td>
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<li>Fourth item</li>
</ul>
</td>
</tr>
<tr>
<td>
<code class="highlighter-rouge">
- First item<br />
- Second item<br />
- Third item<br />
- Indented item<br />
- Indented item<br />
- Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
<ul><br />
<li>First item</li><br />
<li>Second item</li><br />
<li>Third item<br />
<ul><br />
<li>Indented item</li><br />
<li>Indented item</li><br />
</ul><br />
</li><br />
<li>Fourth item</li><br />
</ul>
</code>
</td>
<td>
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ul>
<li>Indented item</li>
<li>Indented item</li>
</ul>
</li>
<li>Fourth item</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h4 id="starting-unordered-list-items-with-numbers">Starting Unordered List Items With Numbers</h4>
<p>If you need to start an unordered list item with a number followed by a period, you can use a backslash (<code class="language-plaintext highlighter-rouge">\</code>) to <a href="#escaping-characters">escape</a> the period.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
- 1968\. A great year!<br />
- I think 1969 was second best.
</code>
</td>
<td>
<code class="highlighter-rouge">
<ul><br />
<li>1968. A great year!</li><br />
<li>I think 1969 was second best.</li><br />
</ul>
</code>
</td>
<td>
<ul>
<li>1968. A great year!</li>
<li>I think 1969 was second best.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h4 id="unordered-list-best-practices">Unordered List Best Practices</h4>
<p>Markdown applications don’t agree on how to handle different delimiters in the same list. For compatibility, don’t mix and match delimiters in the same list — pick one and stick with it.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
- First item<br />
- Second item<br />
- Third item<br />
- Fourth item
</code>
</td>
<td>
<code class="highlighter-rouge">
+ First item<br />
* Second item<br />
- Third item<br />
+ Fourth item
</code>
</td>
</tr>
</tbody>
</table>
<h3 id="adding-elements-in-lists">Adding Elements in Lists</h3>
<p>To add another element in a list while preserving the continuity of the list, indent the element four spaces or one tab, as shown in the following examples.</p>
<div class="alert alert-success">
<i class="fas fa-lightbulb"></i> <strong>Tip:</strong> If things don't appear the way you expect, double check that you've indented the elements in the list four spaces or one tab.
</div>
<h4 id="paragraphs">Paragraphs</h4>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>* This is the first list item.
* Here's the second list item.
I need to add another paragraph below the second list item.
* And here's the third list item.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<ul>
<li>This is the first list item.</li>
<li>
<p>Here’s the second list item.</p>
<p>I need to add another paragraph below the second list item.</p>
</li>
<li>And here’s the third list item.</li>
</ul>
<h4 id="blockquotes">Blockquotes</h4>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>* This is the first list item.
* Here's the second list item.
> A blockquote would look great below the second list item.
* And here's the third list item.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<ul>
<li>This is the first list item.</li>
<li>
<p>Here’s the second list item.</p>
<blockquote>
<p>A blockquote would look great below the second list item.</p>
</blockquote>
</li>
<li>And here’s the third list item.</li>
</ul>
<h4 id="code-blocks-1">Code Blocks</h4>
<p><a href="#code-blocks">Code blocks</a> are normally indented four spaces or one tab. When they’re in a list, indent them eight spaces or two tabs.</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1. Open the file.
2. Find the following code block on line 21:
<html>
<head>
<title>Test</title>
</head>
3. Update the title to match the name of your website.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<ol>
<li>Open the file.</li>
<li>
<p>Find the following code block on line 21:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <html>
<head>
<title>Test</title>
</head>
</code></pre></div> </div>
</li>
<li>Update the title to match the name of your website.</li>
</ol>
<h4 id="images">Images</h4>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1. Open the file containing the Linux mascot.
2. Marvel at its beauty.

3. Close the file.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<ol>
<li>Open the file containing the Linux mascot.</li>
<li>
<p>Marvel at its beauty.</p>
<picture>
<source srcset="/assets/images/generated/assets/images/tux-480.webp 480w,
/assets/images/generated/assets/images/tux-1080.webp 1080w" type="image/webp" sizes="100vw" />
<img srcset="/assets/images/generated/assets/images/tux-480.png 480w,
/assets/images/generated/assets/images/tux.png-1080.png 1080w" src="/assets/images/generated/assets/images/tux-1080.png" width="20%" alt="Tux, the Linux mascot" loading="lazy" sizes="100vw" />
</picture>
</li>
<li>Close the file.</li>
</ol>
<h4 id="lists">Lists</h4>
<p>You can nest an unordered list in an ordered list, or vice versa.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1. First item
2. Second item
3. Third item
- Indented item
- Indented item
4. Fourth item
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item
<ul>
<li>Indented item</li>
<li>Indented item</li>
</ul>
</li>
<li>Fourth item</li>
</ol>
<h2>Code</h2>
<p>To denote a word or phrase as code, enclose it in backticks (<code class="language-plaintext highlighter-rouge">`</code>).</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">At the command prompt, type `nano`.</code></td>
<td><code class="highlighter-rouge">At the command prompt, type <code>nano</code>. </code></td>
<td>At the command prompt, type <code class="highlighter-rouge">nano</code>.</td>
</tr>
</tbody>
</table>
<h3 id="escaping-backticks">Escaping Backticks</h3>
<p>If the word or phrase you want to denote as code includes one or more backticks, you can escape it by enclosing the word or phrase in double backticks (<code>``</code>).</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Markdown</th>
<th>HTML</th>
<th>Rendered Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>``Use `code` in your Markdown file.``</code></td>
<td><code class="highlighter-rouge"><code>Use `code` in your Markdown file.</code></code></td>
<td><code>Use `code` in your Markdown file.</code></td>
</tr>
</tbody>
</table>
<h3 id="code-blocks">Code Blocks</h3>
<p>To create code blocks, indent every line of the block by at least four spaces or one tab.</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <html>
<head>
</head>
</html>
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code><html>
<head>
</head>
</html>
</code></pre></div></div>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <strong>Note:</strong> To create code blocks without indenting lines, use <a href="/extended-syntax/#fenced-code-blocks">fenced code blocks</a>.
</div>
<h2>Horizontal Rules</h2>
<p>To create a horizontal rule, use three or more asterisks (<code class="language-plaintext highlighter-rouge">***</code>), dashes (<code class="language-plaintext highlighter-rouge">---</code>), or underscores (<code class="language-plaintext highlighter-rouge">___</code>) on a line by themselves.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>***
---
_________________
</code></pre></div></div>
<p>The rendered output of all three looks identical:</p>
<hr />
<h3 id="horizontal-rule-best-practices">Horizontal Rule Best Practices</h3>
<p>For compatibility, put blank lines before and after horizontal rules.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
Try to put a blank line before...<br /><br />
---<br /><br />
...and after a horizontal rule.
</code>
</td>
<td>
<code class="highlighter-rouge">
Without blank lines, this would be a heading.<br />
---<br />
Don't do this!
</code>
</td>
</tr>
</tbody>
</table>
<h2>Links</h2>
<p>To create a link, enclose the link text in brackets (e.g., <code class="language-plaintext highlighter-rouge">[Duck Duck Go]</code>) and then follow it immediately with the URL in parentheses (e.g., <code class="language-plaintext highlighter-rouge">(https://duckduckgo.com)</code>).</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>My favorite search engine is [Duck Duck Go](https://duckduckgo.com).
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<p>My favorite search engine is <a href="https://duckduckgo.com">Duck Duck Go</a>.</p>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <strong>Note:</strong> To link to an element on the same page, see <a href="/extended-syntax/#linking-to-heading-ids">linking to heading IDs</a>. To create a link that opens in a new tab or window, see the section on <a href="/hacks/#link-targets">link targets</a>.
</div>
<h3 id="adding-titles">Adding Titles</h3>
<p>You can optionally add a title for a link. This will appear as a tooltip when the user hovers over the link. To add a title, enclose it in quotation marks after the URL.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>My favorite search engine is [Duck Duck Go](https://duckduckgo.com "The best search engine for privacy").
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<p>My favorite search engine is <a href="https://duckduckgo.com" title="The best search engine for privacy">Duck Duck Go</a>.</p>
<h3 id="urls-and-email-addresses">URLs and Email Addresses</h3>
<p>To quickly turn a URL or email address into a link, enclose it in angle brackets.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><https://www.markdownguide.org>
<fake@example.com>
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<p><a href="https://www.markdownguide.org">https://www.markdownguide.org</a><br />
<a href="mailto:fake@example.com">fake@example.com</a></p>
<h3 id="formatting-links">Formatting Links</h3>
<p>To <a href="#emphasis">emphasize</a> links, add asterisks before and after the brackets and parentheses. To denote links as <a href="#code">code</a>, add backticks in the brackets.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>I love supporting the **[EFF](https://eff.org)**.
This is the *[Markdown Guide](https://www.markdownguide.org)*.
See the section on [`code`](#code).
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<p>I love supporting the <strong><a href="https://eff.org">EFF</a></strong>.<br />
This is the <em><a href="https://www.markdownguide.org">Markdown Guide</a></em>.<br />
See the section on <a href="#code"><code class="language-plaintext highlighter-rouge">code</code></a>.</p>
<h3 id="reference-style-links">Reference-style Links</h3>
<p>Reference-style links are a special kind of link that make URLs easier to display and read in Markdown. Reference-style links are constructed in two parts: the part you keep inline with your text and the part you store somewhere else in the file to keep the text easy to read.</p>
<h4 id="formatting-the-first-part-of-the-link">Formatting the First Part of the Link</h4>
<p>The first part of a reference-style link is formatted with two sets of brackets. The first set of brackets surrounds the text that should appear linked. The second set of brackets displays a label used to point to the link you’re storing elsewhere in your document.</p>
<p>Although not required, you can include a space between the first and second set of brackets. The label in the second set of brackets is not case sensitive and can include letters, numbers, spaces, or punctuation.</p>
<p>This means the following example formats are roughly equivalent for the first part of the link:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">[hobbit-hole][1]</code></li>
<li><code class="language-plaintext highlighter-rouge">[hobbit-hole] [1]</code></li>
</ul>
<h4 id="formatting-the-second-part-of-the-link">Formatting the Second Part of the Link</h4>
<p>The second part of a reference-style link is formatted with the following attributes:</p>
<ol>
<li>The label, in brackets, followed immediately by a colon and at least one space (e.g., <code class="language-plaintext highlighter-rouge">[label]: </code>).</li>
<li>The URL for the link, which you can optionally enclose in angle brackets.</li>
<li>The optional title for the link, which you can enclose in double quotes, single quotes, or parentheses.</li>
</ol>
<p>This means the following example formats are all roughly equivalent for the second part of the link:</p>
<ul>
<li><code class="language-plaintext highlighter-rouge">[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle</code></li>
<li><code class="language-plaintext highlighter-rouge">[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle "Hobbit lifestyles"</code></li>
<li><code class="language-plaintext highlighter-rouge">[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle 'Hobbit lifestyles'</code></li>
<li><code class="language-plaintext highlighter-rouge">[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle (Hobbit lifestyles)</code></li>
<li><code class="language-plaintext highlighter-rouge">[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> "Hobbit lifestyles"</code></li>
<li><code class="language-plaintext highlighter-rouge">[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> 'Hobbit lifestyles'</code></li>
<li><code class="language-plaintext highlighter-rouge">[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> (Hobbit lifestyles)</code></li>
</ul>
<p>You can place this second part of the link anywhere in your Markdown document. Some people place them immediately after the paragraph in which they appear while other people place them at the end of the document (like endnotes or footnotes).</p>
<h4 id="an-example-putting-the-parts-together">An Example Putting the Parts Together</h4>
<p>Say you add a URL as a <a href="#links">standard URL link</a> to a paragraph and it looks like this in Markdown:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends
of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to
eat: it was a [hobbit-hole](https://en.wikipedia.org/wiki/Hobbit#Lifestyle "Hobbit lifestyles"), and that means comfort.
</code></pre></div></div>
<p>Though it may point to interesting additional information, the URL as displayed really doesn’t add much to the existing raw text other than making it harder to read. To fix that, you could format the URL like this instead:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends
of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to
eat: it was a [hobbit-hole][1], and that means comfort.
[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> "Hobbit lifestyles"
</code></pre></div></div>
<p>In both instances above, the rendered output would be identical:</p>
<blockquote>
<p>In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a <a href="https://en.wikipedia.org/wiki/Hobbit#Lifestyle" title="Hobbit lifestyles">hobbit-hole</a>, and that means comfort.</p>
</blockquote>
<p>and the HTML for the link would be:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><a href="https://en.wikipedia.org/wiki/Hobbit#Lifestyle" title="Hobbit lifestyles">hobbit-hole</a>
</code></pre></div></div>
<h3 id="link-best-practices">Link Best Practices</h3>
<p>Markdown applications don’t agree on how to handle spaces in the middle of a URL. For compatibility, try to URL encode any spaces with <code class="language-plaintext highlighter-rouge">%20</code>. Alternatively, if your Markdown application <a href="#html">supports HTML</a>, you could use the <code class="language-plaintext highlighter-rouge">a</code> HTML tag.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
[link](https://www.example.com/my%20great%20page)<br /><br />
<a href="https://www.example.com/my great page">link</a><br /><br />
</code>
</td>
<td>
<code class="highlighter-rouge">
[link](https://www.example.com/my great page)<br /><br />
</code>
</td>
</tr>
</tbody>
</table>
<p>Parentheses in the middle of a URL can also be problematic. For compatibility, try to URL encode the opening parenthesis (<code class="language-plaintext highlighter-rouge">(</code>) with <code class="language-plaintext highlighter-rouge">%28</code> and the closing parenthesis (<code class="language-plaintext highlighter-rouge">)</code>) with <code class="language-plaintext highlighter-rouge">%29</code>. Alternatively, if your Markdown application <a href="#html">supports HTML</a>, you could use the <code class="language-plaintext highlighter-rouge">a</code> HTML tag.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>✅ Do this</th>
<th>❌ Don't do this</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<code class="highlighter-rouge">
[a novel](https://en.wikipedia.org/wiki/<wbr />The_Milagro_Beanfield_War_%28novel%29)<br /><br />
<a href="https://en.wikipedia.org/wiki/<wbr />The_Milagro_Beanfield_War_(novel)">a novel</a><br /><br />
</code>
</td>
<td>
<code class="highlighter-rouge">
[a novel](https://en.wikipedia.org/wiki/<wbr />The_Milagro_Beanfield_War_(novel))
</code>
</td>
</tr>
</tbody>
</table>
<h2>Images</h2>
<p>To add an image, add an exclamation mark (<code class="language-plaintext highlighter-rouge">!</code>), followed by alt text in brackets, and the path or URL to the image asset in parentheses. You can optionally add a title in quotation marks after the path or URL.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<picture>
<source srcset="/assets/images/generated/assets/images/san-juan-mountains-480.webp 480w,
/assets/images/generated/assets/images/san-juan-mountains-1080.webp 1080w" type="image/webp" sizes="100vw" />
<img srcset="/assets/images/generated/assets/images/san-juan-mountains-480.jpg 480w,
/assets/images/generated/assets/images/san-juan-mountains-1080.jpg 1080w" src="/assets/images/generated/assets/images/san-juan-mountains-1080.jpg" class="img-fluid" title="San Juan Mountains" alt="The San Juan Mountains are beautiful" loading="lazy" sizes="100vw" />
</picture>
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> <strong>Note:</strong> To resize an image, see the section on <a href="/hacks/#image-size">image size</a>. To add a caption, see the section on <a href="/hacks/#image-captions">image captions</a>.
</div>
<h3 id="linking-images">Linking Images</h3>
<p>To add a link to an image, enclose the Markdown for the image in brackets, and then add the link in parentheses.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[](https://www.flickr.com/photos/beaurogers/31833779864/in/photolist-Qv3rFw-34mt9F-a9Cmfy-5Ha3Zi-9msKdv-o3hgjr-hWpUte-4WMsJ1-KUQ8N-deshUb-vssBD-6CQci6-8AFCiD-zsJWT-nNfsgB-dPDwZJ-bn9JGn-5HtSXY-6CUhAL-a4UTXB-ugPum-KUPSo-fBLNm-6CUmpy-4WMsc9-8a7D3T-83KJev-6CQ2bK-nNusHJ-a78rQH-nw3NvT-7aq2qf-8wwBso-3nNceh-ugSKP-4mh4kh-bbeeqH-a7biME-q3PtTf-brFpgb-cg38zw-bXMZc-nJPELD-f58Lmo-bXMYG-bz8AAi-bxNtNT-bXMYi-bXMY6-bXMYv)
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<div>
<a href="https://www.flickr.com/photos/beaurogers/31833779864/in/photolist-Qv3rFw-34mt9F-a9Cmfy-5Ha3Zi-9msKdv-o3hgjr-hWpUte-4WMsJ1-KUQ8N-deshUb-vssBD-6CQci6-8AFCiD-zsJWT-nNfsgB-dPDwZJ-bn9JGn-5HtSXY-6CUhAL-a4UTXB-ugPum-KUPSo-fBLNm-6CUmpy-4WMsc9-8a7D3T-83KJev-6CQ2bK-nNusHJ-a78rQH-nw3NvT-7aq2qf-8wwBso-3nNceh-ugSKP-4mh4kh-bbeeqH-a7biME-q3PtTf-brFpgb-cg38zw-bXMZc-nJPELD-f58Lmo-bXMYG-bz8AAi-bxNtNT-bXMYi-bXMY6-bXMYv" class="no-underline">
<picture>
<source srcset="/assets/images/generated/assets/images/shiprock-480.webp 480w,
/assets/images/generated/assets/images/shiprock-1080.webp 1080w" type="image/webp" sizes="100vw" />
<img srcset="/assets/images/generated/assets/images/shiprock-480.jpg 480w,
/assets/images/generated/assets/images/shiprock-1080.jpg 1080w" src="/assets/images/generated/assets/images/shiprock-1080.jpg" class="img-fluid" title="Shiprock, New Mexico by Beau Rogers" alt="An old rock in the desert" loading="lazy" sizes="100vw" />
</picture>
</a>
</div>
<h2>Escaping Characters</h2>
<p>To display a literal character that would otherwise be used to format text in a Markdown document, add a backslash (<code class="language-plaintext highlighter-rouge">\</code>) in front of the character.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>\* Without the backslash, this would be a bullet in an unordered list.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<p>* Without the backslash, this would be a bullet in an unordered list.</p>
<h3 id="characters-you-can-escape">Characters You Can Escape</h3>
<p>You can use a backslash to escape the following characters.</p>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th>Character</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>\</td>
<td>backslash</td>
</tr>
<tr>
<td>`</td>
<td>backtick (see also <a href="#escaping-backticks">escaping backticks in code</a>)</td>
</tr>
<tr>
<td>*</td>
<td>asterisk</td>
</tr>
<tr>
<td>_</td>
<td>underscore</td>
</tr>
<tr>
<td>{ }</td>
<td>curly braces</td>
</tr>
<tr>
<td>[ ]</td>
<td>brackets</td>
</tr>
<tr>
<td>< ></td>
<td>angle brackets</td>
</tr>
<tr>
<td>( )</td>
<td>parentheses</td>
</tr>
<tr>
<td>#</td>
<td>pound sign</td>
</tr>
<tr>
<td>+</td>
<td>plus sign</td>
</tr>
<tr>
<td>-</td>
<td>minus sign (hyphen)</td>
</tr>
<tr>
<td>.</td>
<td>dot</td>
</tr>
<tr>
<td>!</td>
<td>exclamation mark</td>
</tr>
<tr>
<td>|</td>
<td>pipe (see also <a href="/extended-syntax/#escaping-pipe-characters-in-tables">escaping pipe in tables</a>)</td>
</tr>
</tbody>
</table>
<h2>HTML</h2>
<p>Many Markdown applications allow you to use HTML tags in Markdown-formatted text. This is helpful if you prefer certain HTML tags to Markdown syntax. For example, some people find it easier to use HTML tags for images. Using HTML is also helpful when you need to change the attributes of an element, like specifying the <a href="/hacks/#color">color of text</a> or changing the width of an image.</p>
<p>To use HTML, place the tags in the text of your Markdown-formatted file.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>This **word** is bold. This <em>word</em> is italic.
</code></pre></div></div>
<p>The rendered output looks like this:</p>
<p>This <strong>word</strong> is bold. This <em>word</em> is italic.</p>
<h3 id="html-best-practices">HTML Best Practices</h3>
<p>For security reasons, not all Markdown applications support HTML in Markdown documents. When in doubt, check your Markdown application’s documentation. Some applications support only a subset of HTML tags.</p>
<p>Use blank lines to separate block-level HTML elements like <code class="language-plaintext highlighter-rouge"><div></code>, <code class="language-plaintext highlighter-rouge"><table></code>, <code class="language-plaintext highlighter-rouge"><pre></code>, and <code class="language-plaintext highlighter-rouge"><p></code> from the surrounding content. Try not to indent the tags with tabs or spaces — that can interfere with the formatting.</p>
<p>You can’t use Markdown syntax inside block-level HTML tags. For example, <code class="language-plaintext highlighter-rouge"><p>italic and **bold**</p></code> won’t work.</p>
<div class="card bg-light mb-3" style="max-width: 100%; margin-top: 50px;">
<div class="row no-gutters">
<div class="col-md-3">
<a href="/book/">
<picture>
<source srcset="/assets/images/generated/assets/images/book-cover-480.webp 480w,
/assets/images/generated/assets/images/book-cover-1080.webp 1080w"
type="image/webp"
sizes="100vw">
<img srcset="/assets/images/generated/assets/images/book-cover-480.jpg 480w,
/assets/images/generated/assets/images/book-cover-1080.jpg 1080w"
src="/assets/images/generated/assets/images/book-cover-1080.jpg" class="img-fluid" alt="Markdown Guide book cover" loading="lazy" sizes="100vw">
</picture>
</a>
</div>
<div class="col-md-9">
<div class="card-body" style="padding-left: 6%;">
<h5 class="card-title no-anchor" data-toc-skip>Take your Markdown skills to the next level.</h5>
<p class="card-text">Learn Markdown in 60 pages. Designed for both novices and experts, <em>The Markdown Guide</em> book is a comprehensive reference that has everything you need to get started and master Markdown syntax.</p>
<a class="btn btn-success" style="margin-top: 5px; margin-right: 15px" href="/book/">Get the Book</a>
</div>
</div>
</div>
</div>
<div class="card border-info" style="margin-top: 50px">
<h6 class="card-header no-anchor bg-info text-white" data-toc-skip>Want to learn more Markdown?</h6>
<div class="card-body">
<p class="card-text">
Don't stop now! 🚀 Star the <a href="https://github.com/mattcone/markdown-guide">GitHub repository</a> and then enter your email address below to receive new Markdown tutorials via email. No spam!</p>
<form method="post" action="https://pika.forklabs.com/subscription/form" class="listmonk-form">
<div class="form-group" style="margin-top: 20px">
<input type="hidden" name="nonce" />
<input id="b7668" type="hidden" name="l" value="b766881d-27fd-43a8-9b76-1b74f2a76763" />
<input type="email" class="form-control form-control-lg" name="email" placeholder="Your email address" />
</div>
<button type="submit" class="btn btn-success">Stay updated</button>
</form>
</div>
</div>
</div>
<div class="col-md-3 d-none d-md-block" id="sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top" style="z-index:1"></nav>
<div style="position: fixed; bottom: 0px; right: 0px;">
<div data-ea-publisher="markdownguide" data-ea-type="image"></div>
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div class="container">
<p style="font-size: 14px; font-weight: 600"><a href="/about/">About</a> <a href="/contact/">Contact</a> <a href="https://github.com/mattcone/markdown-guide">GitHub</a> <a href="/api/v1/">API</a> <a href="/privacy-policy/">Privacy Policy</a> <a href="/terms-and-conditions/">Terms and Conditions</a></p>
<p style="margin-top: 15px; font-size: 14px;">© 2025. A <a href="https://www.mattcone.com">Matt Cone</a> project. <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>. Made with 🌶️ in <a href="https://www.newmexico.org/">New Mexico</a>.</p>
</div>
</footer>
<script type="text/javascript" src="/assets/javascript/anchor.min.js"></script>
<script>
anchors.options = {
placement: 'right',
};
anchors.add('h1, h2, h3, h4, h5').remove('.no-anchor');
</script>
<!-- for search -->
<script src="/assets/javascript/docsearch.min.js"></script>
<script>
docsearch({
container: '#docsearch',
appId: 'G2ZRR9A979',
apiKey: 'f522befe6142f2279344e025a79539a7',
indexName: 'markdownguide'
});
</script>
</body>
</html>