Documentation
Home · Docs · Markdown · Bold and italic in Markdown

Bold and italic in Markdown

How to make text bold and italic in Markdown with asterisks or underscores, including bold italic, the intraword rule, and the HTML output.

To make text bold in Markdown, wrap it in two asterisks or two underscores, such as **bold** or __bold__. To make text italic, wrap it in one asterisk or one underscore, such as *italic* or _italic_. For both at once, use three, as in ***bold and italic***. Asterisks and underscores are interchangeable at the edges of words, but only asterisks work reliably in the middle of a word.

Bold and italic in Markdown syntax reference

Goal Syntax Result
Italic *text* or _text_ text
Bold **text** or __text__ text
Bold and italic ***text*** or ___text___ text

Bold and italic in Markdown key facts

  • **text** or __text__ makes text bold, which compiles to the HTML <strong> element.
  • *text* or _text_ makes text italic, which compiles to the HTML <em> element.
  • ***text*** or ___text___ makes text both bold and italic, nesting <em> and <strong> together.
  • Asterisks and underscores work the same at the edges of a word, but inside a word only asterisks emphasize reliably.
  • CommonMark and GitHub Flavored Markdown ignore underscores flanked by letters or numbers, so identifiers like user_id are left alone.
  • To show a literal asterisk or underscore, escape it with a backslash, for example \* or \_.

Choose delimiters that stay readable in source

Asterisks and underscores can both create emphasis, but they do not behave identically inside words. Asterisks are usually the more portable choice for italic and bold text in technical documentation. Underscores are useful when a style guide requires them, but intraword underscores are often treated as literal characters.

Keep punctuation outside the emphasis markers unless it belongs to the emphasized phrase. For filenames, commands, and identifiers, use inline code instead of bold or italic styling. If emphasis appears next to other punctuation-heavy syntax, preview the result and use backslash escaping only where the parser requires it.

Italic

Wrap text in a single asterisk or a single underscore to make it italic.

Markdown

This is *italic* and so is _this_.

Rendered output

This is italic and so is this.

HTML output

<p>This is <em>italic</em> and so is <em>this</em>.</p>

Italic text compiles to the HTML <em> (emphasis) element.

Bold

Wrap text in two asterisks or two underscores to make it bold.

Markdown

This is **bold** and so is __this__.

Rendered output

This is bold and so is this.

HTML output

<p>This is <strong>bold</strong> and so is <strong>this</strong>.</p>

Bold text compiles to the HTML <strong> element, which the CommonMark spec calls "strong emphasis."

Bold and italic combined

Wrap text in three asterisks or three underscores to make it both bold and italic.

Markdown

This is ***bold and italic*** text.

Rendered output

This is bold and italic text.

HTML output

<p>This is <em><strong>bold and italic</strong></em> text.</p>

You can also mix markers to be explicit, for example **bold with _italic_ inside**, which nests the emphasis cleanly.

Markdown

**Bold text with an _italic_ word inside.**

Rendered output

Bold text with an italic word inside.

Asterisks vs underscores: the intraword rule

At the start and end of a word, asterisks and underscores behave the same. Inside a word they do not. CommonMark and GitHub Flavored Markdown deliberately ignore underscores that are flanked by letters or numbers, so identifiers like user_id are not mangled. Asterisks have no such restriction.

Markdown

Intraword with asterisks: super*cali*fragilistic

Intraword with underscores: super_cali_fragilistic

Rendered output

Intraword with asterisks: supercalifragilistic

Intraword with underscores: super_cali_fragilistic

The asterisk version emphasizes the middle of the word. The underscore version renders the underscores literally, leaving super_cali_fragilistic untouched. For any emphasis inside a word, use asterisks.

Emphasis and surrounding spaces

The markers must sit directly against the text, with no space between the marker and the first or last character. * text * with inner spaces does not create emphasis in most parsers.

Markdown

Correct: **bold**

Incorrect: ** not bold **

Rendered output

Correct: bold

Incorrect: ** not bold **

Flavor differences

Basic bold and italic are universal. The one meaningful difference is the intraword underscore rule, which CommonMark and GFM enforce and classic Markdown did not. The table summarises the documented behaviour of the named flavors; confirm unusual delimiter combinations in the destination renderer.

Flavor Italic and bold Intraword underscore emphasis Notes
CommonMark Yes No Underscores flanked by alphanumerics are ignored. Asterisks always work.
GitHub Flavored Markdown (GFM) Yes No Superset of CommonMark, same intraword rule.
MultiMarkdown Yes No Ignores intraword underscores, same as CommonMark. Use asterisks intraword.
Markdown Extra Yes No PHP Markdown Extra leaves underscores inside a word literal, same as CommonMark. Use asterisks intraword.
Pandoc Yes No Matches CommonMark: underscores are not intraword emphasis. Asterisks are.

The safe, portable rule is simple: use asterisks for all emphasis, and especially inside words. That single habit works across CommonMark, GFM, and most modern Markdown renderers.

Other platforms (Slack, Discord, Reddit)

Chat tools use their own emphasis conventions, which differ from standard Markdown:

  • Slack: uses a single asterisk *bold* for bold and a single underscore _italic_ for italic. Double asterisks do not mean bold in Slack.
  • Discord: follows standard Markdown, so *italic*, **bold**, and ***both*** all work, and it adds __underline__ (double underscore) for underline, not bold.
  • Reddit: standard Markdown emphasis, with *italic* and **bold**.

Because Slack and Discord reinterpret the same markers, emphasis is one of the elements most likely to change meaning when you paste between tools. Verify after pasting.

For the full comparison of how flavors differ across all elements, see Markdown flavors.

How Markdific renders it

Markdific renders single-marker emphasis as italic (<em>), double-marker as bold (<strong>), and triple-marker as bold italic, following the CommonMark intraword rule for underscores.

Try it in the Markdific online editor.

Common mistakes and gotchas

  • Using underscores inside a word. user_id_field will not italicize in CommonMark and GFM. Use asterisks for intraword emphasis.
  • Spaces inside the markers. ** bold ** with inner spaces does not render as bold. Keep the markers against the text.
  • Unbalanced markers. **bold* with mismatched counts renders unpredictably. Match the opening and closing markers.
  • Wanting literal asterisks or underscores. Escape them with a backslash, for example \*not italic\*, to show the characters. See the escaping characters page.
  • Assuming Slack uses double asterisks. Slack bold is a single asterisk. The same markers mean different things across tools.
  • Very long emphasis spans. Emphasis is meant for words and short phrases. Emphasizing whole paragraphs is hard to read and easy to get wrong.

Best practices

  • Use asterisks as your default for both bold and italic, so intraword emphasis always works.
  • Use ** for bold and * for italic consistently across a document.
  • Do not put spaces between the markers and the text.
  • Use emphasis sparingly. Overusing bold and italic reduces their impact.
  • Escape literal * and _ characters when you mean the symbol rather than emphasis.
  • Check emphasis after pasting into Slack or Discord, where the markers can be reinterpreted.

HTML equivalent

Italic compiles to <em>, bold to <strong>, and the two combined nest one inside the other.

Markdown

*italic*, **bold**, and ***both***

HTML output

<p><em>italic</em>, <strong>bold</strong>, and <em><strong>both</strong></em></p>

FAQ

How do you make text bold in Markdown? Wrap the text in two asterisks or two underscores, for example **bold** or __bold__. It compiles to the HTML <strong> element.

How do you make text italic in Markdown? Wrap the text in one asterisk or one underscore, for example *italic* or _italic_. It compiles to the HTML <em> element.

How do you make text bold and italic at the same time? Wrap it in three asterisks or three underscores, for example ***text***. You can also nest, such as **bold with _italic_ inside**.

What is the difference between asterisks and underscores for emphasis? They behave the same at word boundaries. Inside a word, only asterisks work in CommonMark and GFM, because underscores flanked by letters or numbers are ignored to protect identifiers like user_id.

Why is my underscore emphasis not working inside a word? CommonMark and GitHub Flavored Markdown ignore underscores in the middle of a word by design. Use asterisks for intraword emphasis instead.

How do you show a literal asterisk or underscore in Markdown? Escape it with a backslash, for example \* or \_, so the parser prints the character instead of treating it as an emphasis marker.

Does emphasis work the same in Slack and Discord? No. Slack uses a single asterisk for bold and a single underscore for italic. Discord follows standard Markdown and uses double underscores for underline. Check emphasis after pasting.

What HTML does Markdown emphasis produce? Italic produces <em>, bold produces <strong>, and bold italic nests <em> and <strong> together.

How do you underline text in Markdown? Standard Markdown has no underline syntax, because underline is not an emphasis element. Where inline HTML is allowed, use the <u> tag, for example <u>underlined</u>. In Discord, double underscores such as __text__ produce underline rather than bold.

Can you make text bold or italic inside a heading or a link? Yes. Emphasis markers work inside headings and inside link text, so ## A **bold** word bolds a word in a heading, and [**bold link**](https://example.com) bolds the link text. The markers nest with the surrounding syntax.

Why is my bold text showing the asterisks instead of rendering? The most common causes are a space between the marker and the text, such as ** bold **, or an unbalanced number of markers, such as **bold*. Keep the markers tight against the text and match the opening and closing counts.

Does bold or italic work inside inline code? No. Everything inside backticks is treated literally, so `**text**` shows the asterisks as characters rather than rendering bold. Emphasis only applies in normal text, not inside code spans or code blocks.

Sources and compatibility references

Use these primary references for syntax rules. Renderer behaviour can still vary by version and configuration, so preview important documents in their final destination.