What is Markdown?
Markdown is a lightweight markup language created by John Gruber in 2004. It allows you to write formatted text using a simple, readable syntax that can be converted to HTML and other formats. Today, Markdown is used everywhere from GitHub to Notion, from technical documentation to blog posts.
The beauty of Markdown lies in its simplicity. Unlike HTML or rich text formats, Markdown uses intuitive symbols that are easy to remember and quick to type. This guide will teach you everything you need to know to start writing in Markdown.
Why Learn Markdown?
Before diving into the syntax, let's understand why Markdown is worth learning:
- Universal Compatibility: Markdown works on virtually every platform and application.
- Future-Proof: Plain text files will always be readable, unlike proprietary formats.
- Version Control Friendly: Perfect for Git and other version control systems.
- Fast to Write: No need to reach for your mouse or navigate formatting menus.
- Easy to Read: Even the raw source is readable and understandable.
Basic Syntax
Headings
Headings are created using the hash symbol (#). The number of hashes indicates the heading level:
# Heading 1 (largest)
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6 (smallest)
Pro tip: Always put a space after the hash symbols. Some Markdown processors require it.
Paragraphs and Line Breaks
Paragraphs are separated by blank lines:
This is the first paragraph.
This is the second paragraph.
For a line break within a paragraph, end the line with two spaces or use <br>:
This is line one.
This is line two.
Text Formatting
Markdown supports several text formatting options:
**Bold text** or **also bold**
_Italic text_ or _also italic_
**_Bold and italic_** or **_also works_**
~~Strikethrough text~~
Results:
- Bold text
- Italic text
- Bold and italic
Strikethrough text
Blockquotes
Use the greater-than symbol (>) for blockquotes:
> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes are also possible.
This is a blockquote. It can span multiple lines.
Lists
Unordered Lists
Use -, *, or + followed by a space:
- Item one
- Item two
- Nested item
- Another nested item
- Item three
Ordered Lists
Use numbers followed by a period:
1. First item
2. Second item
3. Third item
1. Nested numbered item
2. Another nested item
Pro tip: You can use 1. for all items, and Markdown will automatically number them correctly.
Task Lists
Many Markdown processors support task lists:
- [x] Completed task
- [ ] Incomplete task
- [ ] Another task to do
Links and Images
Links
Create links using square brackets for the text and parentheses for the URL:
[Visit DocFlat](https://www.docflat.com)
[Link with title](https://www.docflat.com "DocFlat Homepage")
For automatic links, use angle brackets:
<https://www.docflat.com>
<contact@docflat.com>
Reference-Style Links
For cleaner documents with many links:
Check out [DocFlat][docflat] for PDF conversion.
Read more on [our blog][blog].
[docflat]: https://www.docflat.com
[blog]: https://www.docflat.com/blog
Images
Images use similar syntax with an exclamation mark prefix:


Tables
Create tables using pipes (|) and hyphens (-):
| Header 1 | Header 2 | Header 3 |
| -------- | -------- | -------- |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
Column Alignment
Use colons to specify alignment:
| Left | Center | Right |
| :------ | :-----: | ------: |
| Aligned | Aligned | Aligned |
| Left | Center | Right |
| Left | Center | Right |
|---|---|---|
| Aligned | Aligned | Aligned |
| Left | Center | Right |
Code
Inline Code
Use backticks for inline code:
Use the `print()` function in Python.
Code Blocks
Use triple backticks for code blocks. Specify the language for syntax highlighting:
```python
def hello_world():
print("Hello, World!")
```
def hello_world():
print("Hello, World!")
Fenced Code Blocks
You can also use indentation (4 spaces or 1 tab):
function example() {
return true;
}
Horizontal Rules
Create horizontal rules with three or more hyphens, asterisks, or underscores:
---
---
---
Advanced Syntax
Footnotes
Some Markdown processors support footnotes:
Here's a sentence with a footnote.[^1]
[^1]: This is the footnote content.
Definition Lists
Term 1
: Definition of term 1
Term 2
: Definition of term 2
Abbreviations
The HTML specification is maintained by the W3C.
_[HTML]: Hypertext Markup Language
_[W3C]: World Wide Web Consortium
Markdown Flavors
Different platforms may support different Markdown features:
- CommonMark: The standardized specification
- GitHub Flavored Markdown (GFM): Adds tables, task lists, and more
- MultiMarkdown: Extended syntax with citations and more
- Markdown Extra: PHP implementation with additional features
Best Practices
-
Be Consistent: Pick one style (e.g.,
*vs-for lists) and stick with it. -
Use Blank Lines: Separate different elements with blank lines for clarity.
-
Keep Lines Reasonable: While Markdown doesn't require line breaks, keeping lines under 80-100 characters improves readability.
-
Preview Your Work: Use a Markdown preview tool to check formatting.
-
Use Reference Links: For documents with many links, reference-style links keep the source readable.
-
Escape Special Characters: Use backslash (
\) to escape characters like*,_,[, etc.
Common Mistakes to Avoid
-
Forgetting spaces after headings:
#Headingwon't work; use# Heading. -
Missing blank lines: Always put blank lines before and after headings, lists, and code blocks.
-
Incorrect nesting: Use consistent indentation (2 or 4 spaces) for nested lists.
-
Unescaped special characters: If you want literal
*or_, escape them with\.
Tools and Resources
Online Editors
- Dillinger
- StackEdit
- HackMD
Desktop Applications
- Typora
- Mark Text
- Obsidian
Learning Resources
- CommonMark specification
- GitHub Markdown Guide
- Markdown Tutorial (markdowntutorial.com)
Conclusion
Markdown is an essential skill for anyone working with text content, especially in technical fields. Its simplicity makes it easy to learn, while its flexibility makes it powerful enough for complex documents.
Start with the basics covered in this guide, and gradually incorporate more advanced features as you become comfortable. Before long, you'll be writing Markdown without even thinking about it.
Ready to put your new Markdown knowledge to use? Convert your existing PDF documents to Markdown with DocFlat and start editing them right away!