Markdown Basic Syntax Guide
Markdown basic syntax consists of the 11 formatting elements John Gruber defined in the original 2004 design document, and nearly every markdown application in 2026 still supports the full set. The 11 elements are headings, paragraphs, line breaks, emphasis, blockquotes, lists, code, horizontal rules, links, images, and character escaping. Each element uses punctuation that already sits on your keyboard, and each one converts to a specific HTML tag. Small differences exist between processors, so this guide flags the choices that render identically everywhere. Every example below pastes straight into a markdown editor with live preview, and the rendered output appears as you type.
Headings
A heading starts with 1 to 6 number signs (#) followed by a space, and the count of signs sets the level from H1 through H6.
# Heading level 1
## Heading level 2
### Heading level 3
#### Heading level 4
##### Heading level 5
###### Heading level 6
Each line converts to the matching HTML tag, so # Page Title renders as an h1 element and ###### Fine Print renders as an h6. Markdown also has an alternate syntax for the top 2 levels. Put any number of equals signs on the line below the text for an H1, or any number of dashes for an H2. The # form is known as ATX style; the underline form is known as Setext style.
Heading level 1
===============
Heading level 2
---------------
Best practice: put a blank line before and after every heading, and keep 1 space between the number signs and the text, so the heading renders correctly in every application.
Paragraphs
A paragraph is one or more consecutive lines of text with a blank line above and below it, and it needs no markers at all.
The first paragraph ends here.
A blank line above this sentence starts a second paragraph.
The renderer wraps each block in a p tag, so the 2 blocks above become 2 separate HTML paragraphs. Single returns inside a block collapse into continuous text, which means you can hard-wrap source lines at 80 characters and the output stays one unbroken paragraph.
Best practice: keep every paragraph flush against the left margin, because 4 or more leading spaces turn a paragraph into a code block.
Line Breaks
A line break inside a paragraph requires 2 or more trailing spaces at the end of a line, or the HTML tag <br>.
This line ends with 2 trailing spaces.
This line appears directly below it.
This line ends with a br tag.<br>
This line also sits inside the same paragraph.
Both methods render a br element, so the second line lands directly under the first without a paragraph gap. A plain return with nothing after it merges the 2 lines into one. CommonMark also accepts a trailing backslash as a break, but older processors ignore it, so the 2 portable options remain trailing spaces and the <br> tag.
Best practice: choose the <br> tag when a break has to survive copy-paste and code review, since trailing spaces stay invisible in most editors.
Emphasis
Bold text takes 2 asterisks on each side, italic takes 1, and bold italic takes 3; underscores serve as an equal alternative around whole words.
This word is **bold** and so is this __word__.
This word is *italic* and so is this _word_.
This phrase is ***bold and italic***.
The renderer converts the markers into strong and em tags: **bold** becomes <strong>bold</strong>, *italic* becomes <em>italic</em>, and the triple marker nests one tag inside the other. Emphasis works inside a word as well, so un*believ*able italicises only the 6 middle letters.
Best practice: use asterisks rather than underscores for mid-word emphasis, because every major processor handles interior asterisks the same way while interior underscores vary.
Blockquotes
A blockquote begins with a greater-than sign (>) at the start of a line, and each quoted line carries its own marker.
> A single-paragraph quote needs 1 marker per line.
>
> A marked blank line continues the quote into a second paragraph.
>
>> Two markers push this paragraph 1 level deeper as a nested quote.
The output is a blockquote element, and the double marker nests a second blockquote inside the first. Quotes hold other markdown too. A heading, a list, or bold text renders normally inside the quote when each of its lines starts with the > marker, which suits quoted emails and cited passages with structure of their own.
Best practice: surround every blockquote with blank lines so each processor detects exactly where the quote starts and stops.
Lists
An ordered list places a number and a period before each item, and an unordered list places a dash, asterisk, or plus sign before each item.
1. First step
2. Second step
3. Third step
1. Indented sub-step
- Bullet item
- Bullet item
- Nested bullet
Ordered lists render as ol elements and count from the first number you type, so a list written as 1, 8, 3 still outputs 1, 2, 3. Unordered lists render as ul elements with any of the 3 delimiters. An indent of 4 spaces or 1 tab nests a sub-list, and the same indent keeps other elements inside a list item: a paragraph or blockquote needs 4 spaces, while a code block inside a list needs 8 spaces because the standard 4-space code indent stacks on top of the list indent.
Best practice: keep 1 delimiter style per list and end ordered numbers with periods rather than parentheses, since the period form works in every markdown application.
Code
Inline code sits between single backticks, and a code block is any run of lines indented by at least 4 spaces or 1 tab.
Type `git status` to check the working tree.
<html>
<head></head>
</html>
The backtick pair renders a code element in a monospaced font, and the indented block renders inside pre and code tags with every space preserved. A snippet that itself contains a backtick needs double backticks around it, so the outer pair displays `code` literally. Fenced code blocks with triple backticks belong to extended syntax; the 4-space indent is the original method.
Best practice: wrap literal backticks in double backticks so the inner character prints instead of closing the code span early.
Horizontal Rules
A horizontal rule requires 3 or more asterisks, dashes, or underscores alone on their own line.
***
---
___
All 3 versions render an identical hr element, a full-width divider. The character can repeat past 3 with no change in output, so a line of 20 dashes produces the same rule as 3. Writers use rules to mark scene changes and section boundaries where a heading would be too heavy.
Best practice: leave a blank line above and below each rule, because a dash-only line placed directly under text turns that text into an H2 heading instead.
Links
An inline link wraps the link text in square brackets and follows it immediately with the URL in parentheses, plus an optional quoted title.
Read the [original spec](https://daringfireball.net/projects/markdown/ "Gruber's 2004 spec").
Reference style keeps prose clean: read the [original spec][1].
[1]: https://daringfireball.net/projects/markdown/
Bare addresses work in angle brackets: <https://example.com> and <mail@example.com>
Every form renders an a element, and the title text appears as a tooltip on hover. Reference-style links split the URL away from the sentence: the [1] label points to a definition that can sit anywhere in the file, so a paragraph full of long URLs stays readable in source form. Angle brackets convert a raw URL or email address into a clickable link with zero extra text. Links also accept formatting, so asterisks around the whole construction bold the link and backticks inside the brackets render it as code.
Best practice: encode any space inside a URL as %20 so the full address survives in every processor.
Images
An image uses an exclamation mark, then alt text in square brackets, then the image path or URL in parentheses.

[](https://example.com/report)
The first line renders an img element with the alt text as its accessibility label and the quoted title as hover text. The syntax matches a link with 1 extra character in front. The second line nests the whole image construction inside a link, so a click on the picture opens the target URL.
Best practice: write alt text that describes the image content, because screen readers and search engines read it in place of the picture.
Escaping Characters
A backslash () placed before a formatting character displays that character literally instead of activating its markdown function.
\* This line shows a literal asterisk, not a bullet point.
1968\. The escaped period stops this year from starting an ordered list.
The backslash itself never appears in the output; only the character behind it prints. Markdown accepts a backslash escape for 12 characters: backslash, backtick, asterisk, underscore, curly braces, square brackets, parentheses, pound sign, plus sign, minus sign, dot, and exclamation mark. The second example above solves a common trap, since any line that opens with a number and a period becomes a list item without the escape.
Best practice: escape only the characters on that 12-item list, because a backslash before any other character prints as a visible backslash.
Frequently asked questions
What is markdown basic syntax?
Basic syntax is the 11-element feature set from John Gruber's 2004 markdown design document, and nearly every markdown application supports all of it. The 11 elements behave consistently across processors, which makes the basic set the safest choice for documents that travel between platforms.
How many heading levels does markdown support?
Markdown supports 6 heading levels, written with 1 to 6 number signs, and they map directly to the HTML tags h1 through h6. The alternate underline syntax covers only the top 2 levels: equals signs for H1 and dashes for H2.
How do I add a line break without starting a new paragraph?
End the line with 2 trailing spaces or with the <br> HTML tag. Both render a br element inside the current paragraph. A blank line has a different effect: it closes the paragraph and opens a new one.
Is basic syntax enough, or do I need extended syntax?
Basic syntax covers standard documents, while extended syntax adds tables, fenced code blocks, footnotes, and other elements from later specifications such as GFM. Start with the basic set for maximum compatibility, then add extended elements once you know the target platform supports them.
