Markdig is fully compliant with the CommonMark specification (v0.31.2), passing 600+ spec tests. This page is a reference for all core Markdown syntax supported out of the box — no extensions required.
Use # characters (1–6) followed by a space:
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Underline text with = (level 1) or - (level 2):
Heading 1
=========
Heading 2
---------
Paragraphs are separated by one or more blank lines. A single newline within a paragraph does not create a line break — it's treated as a space.
This is the first paragraph.
This is the second paragraph. This sentence
continues on the next line but renders inline.
To create a hard line break within a paragraph, end a line with two or more spaces or a backslash \:
First line
Second line (two trailing spaces above)
First line\
Second line (backslash above)
*italic text* or _italic text_
**bold text** or __bold text__
***bold and italic*** or ___bold and italic___
Renders as:
[Link text](https://example.com)
[Link with title](https://example.com "Example Title")
[Link text][ref]
[Another link][ref]
[ref]: https://example.com "Optional Title"
Angle brackets around a URL or email:
<https://example.com>
<user@example.com>


![Alt text][imgref]
[imgref]: https://example.com/image.png "Title"
Use the `Markdown.ToHtml()` method.
Use the Markdown.ToHtml() method.
Use triple backticks or triple tildes, optionally with a language identifier:
```csharp
var html = Markdown.ToHtml("Hello **world**!");
```
Or with tildes:
~~~python
print("Hello, world!")
~~~
Indent every line by 4 spaces or 1 tab:
var x = 42;
Console.WriteLine(x);
Prefix lines with >:
> This is a blockquote.
>
> It can span multiple paragraphs.
>
> > And be nested.
This is a blockquote.
It can span multiple paragraphs.
And be nested.
Use -, *, or + as markers:
- Item one
- Item two
- Nested item
- Item three
Use numbers followed by . or ):
1. First item
2. Second item
3. Third item
1) Also valid
2) With parentheses
Indent content to align with the list item text:
1. First paragraph of item.
Second paragraph of the same item.
2. Another item.
Three or more -, *, or _ on a line (optionally with spaces):
---
***
___
Raw HTML can be included directly:
<div class="custom">
This is raw HTML.
</div>
HTML tags can appear within inline content:
This is <em>inline HTML</em> in a paragraph.
Use a backslash \ to escape special characters:
\*Not italic\*
\# Not a heading
\[Not a link\]
The following characters can be escaped: \ ` * _ { } [ ] ( ) # + - . ! |
HTML entities are supported:
© & < >
© ©
Blank lines separate block elements. Multiple consecutive blank lines are treated the same as a single blank line.