Markdown Complete Guide: Syntax, Tips & Best Practices

Β· 12 min read

What Is Markdown?

Markdown is a lightweight markup language created by John Gruber in 2004. It lets you write formatted text using plain text syntax that is easy to read and write. Instead of clicking buttons in a word processor or writing HTML tags, you use simple characters like # for headings, ** for bold, and - for lists.

Markdown has become the standard for technical writing, documentation, README files, blog posts, and note-taking. Platforms like GitHub, Reddit, Stack Overflow, Discord, and Notion all support Markdown natively.

The beauty of Markdown is that the source text remains readable even without rendering. A Markdown document looks clean in any text editor, unlike HTML which is cluttered with tags.

Why Use Markdown?

Headings

Headings use the # symbol. The number of hashes determines the heading level (1-6):

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

Always put a space after the # symbol. Most Markdown processors require it. Use heading levels sequentially β€” don't skip from H1 to H3. This matters for accessibility and SEO.

Text Formatting

FormatSyntaxResult
Bold**bold**bold
Italic*italic*italic
Bold + Italic***both***both
Strikethrough~~deleted~~deleted
Inline code`code`code

Lists

Unordered Lists

Use -, *, or + followed by a space. Nest with 2-space indent:

- First item
- Second item
  - Nested item
- Third item

Ordered Lists

1. First item
2. Second item
3. Third item

Task Lists (GFM)

- [x] Completed task
- [ ] Incomplete task
[Link text](https://example.com)
[Link with title](https://example.com "Title")
![Alt text](image.png)

Always include descriptive alt text for images. Use our Markdown to HTML converter to preview how your links render.

Code Blocks

Inline code uses backticks: `variable`. Fenced code blocks use triple backticks with a language identifier:

```javascript
function greet(name) {
  return `Hello, ${name}!`;
}
```

Common languages: javascript, python, html, css, bash, json, sql, typescript.

Tables

| Feature     | Markdown | HTML   |
|-------------|----------|--------|
| Readability | High     | Low    |
| Speed       | Fast     | Slow   |

Alignment: :--- left, :---: center, ---: right.

Blockquotes and Horizontal Rules

> This is a blockquote.
> > Nested blockquotes work too.

---

Extended Syntax

Footnotes

Text with a footnote.[^1]
[^1]: Footnote content.

Definition Lists

Term
: Definition of the term

HTML in Markdown

When Markdown syntax is not enough, use raw HTML. Most processors support <details>, <summary>, <kbd>, and other tags.

Markdown Flavors

FlavorUsed ByExtra Features
CommonMarkStandard specStrict parsing rules
GFMGitHubTables, task lists, strikethrough
MDXReact docsJSX components in Markdown
R MarkdownRStudioCode execution, visualization

Best Practices

  1. One sentence per line β€” Makes diffs cleaner in version control
  2. Consistent heading hierarchy β€” Never skip levels
  3. Alt text on images β€” Required for accessibility
  4. Blank lines around blocks β€” Headings, lists, code blocks need them
  5. Use fenced code blocks β€” Clearer than indented code
  6. Lint your Markdown β€” markdownlint catches common issues
  7. Preview before publishing β€” Use TxtTool's Markdown Editor

Frequently Asked Questions

What is the difference between Markdown and HTML?

Markdown is a lightweight markup language that converts to HTML. It uses simple symbols like # for headings and ** for bold, making it faster to write than HTML tags.

Which Markdown flavor should I use?

GitHub Flavored Markdown (GFM) is the most widely supported. It adds tables, task lists, strikethrough, and autolinks to standard Markdown.

Can I use HTML inside Markdown?

Yes, most Markdown processors allow inline HTML for features Markdown does not support, like colored text or complex layouts.

How do I create a table in Markdown?

Use pipes and hyphens: | Header | followed by | --- | for separator, then | Cell | for rows. Use colons for alignment.

What apps support Markdown?

GitHub, Reddit, Stack Overflow, Discord, Slack, Notion, Obsidian, VS Code, and most documentation platforms support Markdown natively.

Related Tools

Markdown to HTML Markdown Editor HTML to Markdown