Markdown Syntax Guide
Complete Markdown syntax reference for writing beautifully formatted documents
Markdown is a lightweight markup language that lets you format documents with simple text symbols. Its syntax is concise and intuitive, with a gentle learning curve, making it ideal for technical documentation, blog posts, and note-taking. This guide covers all Markdown syntax supported by MarkPDF.
Headings
Use # symbols to create headings, the number of # indicates heading level, from H1 to H6
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6>
Paragraphs and Line Breaks
Separate paragraphs with blank lines. For line breaks within a paragraph, add two spaces at the end of the line before pressing enter
This is paragraph one. This is paragraph two. Line one with two spaces at end Line two (soft break)
<p>This is paragraph one.</p> <p>This is paragraph two.</p> <p>Line one with two spaces at end<br> Line two (soft break)</p>
Emphasis
Use asterisks or underscores around text to add emphasis effects
*Italic* or _italic_ **Bold** or __bold__ ***Bold and italic*** ~~Strikethrough~~
<em>Italic</em> <strong>Bold</strong> <strong><em>Bold and italic</em></strong> <del>Strikethrough</del>
Lists
Supports ordered lists, unordered lists, and nested lists
Unordered list: - Item 1 - Item 2 - Nested item - Another nested Ordered list: 1. First 2. Second 3. Third
<ul> <li>Item 1</li> <li>Item 2 <ul> <li>Nested item</li> <li>Another nested</li> </ul> </li> </ul> <ol> <li>First</li> <li>Second</li> <li>Third</li> </ol>
Links and Images
Use square brackets and parentheses combination to create links and insert images
[Link text](https://example.com) [Link with title](https://example.com "Title") 
<a href="https://example.com">Link text</a> <a href="https://example.com" title="Title">Link with title</a> <img src="https://example.com/image.png" alt="Image alt">
Code
Use backticks for inline code, use triple backticks for code blocks
Inline `code` in text.
```javascript
function hello() {
console.log("Hello!");
}
```<code>code</code>
<pre><code class="language-javascript">
function hello() {
console.log("Hello!");
}
</code></pre>Tables
Use pipes and dashes to create tables, supports alignment settings
| Header 1 | Header 2 | Header 3 | |----------|:--------:|---------:| | Left | Center | Right | | Cell | Cell | Cell |
<table> <thead><tr> <th>Header 1</th> <th align="center">Header 2</th> <th align="right">Header 3</th> </tr></thead> <tbody> <tr><td>Left</td><td>Center</td><td>Right</td></tr> <tr><td>Cell</td><td>Cell</td><td>Cell</td></tr> </tbody> </table>
Blockquotes
Use > symbol to create quote blocks, can be nested
> This is a blockquote. > It can span multiple lines. > > > Nested blockquote
<blockquote> <p>This is a blockquote. It can span multiple lines.</p> <blockquote><p>Nested blockquote</p></blockquote> </blockquote>
Horizontal Rules
Use three or more dashes, asterisks, or underscores to create horizontal dividers
--- *** ___
<hr>
Escape Characters
Use backslash to escape special characters, displaying them as plain text
\*Not italic\* \# Not a heading \[Not a link\]
*Not italic* # Not a heading [Not a link]