Asterisks in Markdown

One asterisk on each side makes italic (*text*), two make bold (**text**) and three make both. A * followed by a space at the start of a line makes a bullet point. To show a real asterisk, put a backslash before it: \*.

Quick reference

These follow CommonMark and GitHub Flavored Markdown, which GitHub, GitLab, Reddit, Stack Overflow, Obsidian and most static site generators use. This page itself is built with a CommonMark parser, so the right-hand column is the real output.

You type You get
*italic* italic
**bold** bold
***bold italic*** bold italic
* item at the start of a line A bullet point
*** or * * * on a line by itself A horizontal rule
\*not italic\* *not italic*
2 * 3 * 4 2 * 3 * 4
2*3*4 234

That last row is the trap: the 3 comes out in italics.

When asterisks turn into formatting

An opening * has to touch the text it starts, and a closing * has to touch the text it ends. So:

  • *this is* becomes italic.
  • this * is not* italic stays as typed, because a space follows the first *.
  • 2 * 3 * 4 stays as typed. Spaces around an asterisk keep it literal.
  • 2*3*4 becomes "2, italic 3, 4", because asterisks also work inside words.

Underscores behave differently inside words. snake_case_name stays as typed, while un*frigging*believable turns the middle into italics. That makes * the one to use for emphasis in the middle of a word, and the one to watch in math and code written outside backticks.

Showing a literal asterisk

Method You type Best for
Backslash escape \* One-off asterisks in text, like a footnote marker: Free\*
Code span `2*3*4` Math, code and file patterns
Code block Three backticks before and after Anything longer than a line
HTML entity * Places where backslashes get eaten, such as some templating systems

At the start of a line, * Terms apply becomes a bullet, but *Terms apply (no space) stays as text. If the line also contains a second *, escape the first one: \*Terms apply, see note*.

Bullet lists

*, - and + all make the same kind of bullet. They aren't interchangeable within one list, though: switching from * to - partway through starts a new list, which some renderers draw with extra space between the two. Pick one marker per document; many style guides and linters choose -.

Where Markdown isn't quite Markdown

Chat apps borrow the syntax and change the rules. In Slack and WhatsApp, a single pair of asterisks makes bold, not italic, and Discord uses its own variant. Our guide to asterisks in texting covers each app.

Older parsers that predate CommonMark, including the original 2004 Markdown.pl, can disagree on edge cases like 2*3*4 and nested emphasis. If something renders oddly on one site and fine on another, the parser is the likely difference, and an escape fixes both.