# all·markdown

How to bold and italicise text in Markdown

Try it - edit the markdown and watch the preview

Visual

Open the full editor Runs in this tab, nothing is uploaded.

Two asterisks make text bold, one makes it italic, three make it both:

**bold**  *italic*  ***both***

Underscores do the same job - __bold__, _italic_ - with one important difference.

Asterisks are the safer default

Inside a word, underscores are ignored on purpose:

snake_case_name     stays literal
mid*word*emphasis   italicises "word"

That rule exists so identifiers like user_id_field survive intact. It also means underscores fail silently when you actually wanted emphasis mid-word. If you standardise on one marker, standardise on asterisks.

The usual reason it does not work

Spaces between the markers and the text:

** not bold **      renders the asterisks literally
**bold**            works

The markers have to touch the text they wrap. An unclosed pair leaves the characters visible too, which is the other common cause.

Bold is not a heading

It is tempting to bold a line instead of writing ##. The output looks similar and the meaning is not: a heading appears in the table of contents, gets an id you can link to, and tells a screen reader that a new section has started. Bolded text does none of that. Use a heading when you mean a heading.

Common questions

How do I make text bold?
Wrap it in two asterisks: **like this**. Two underscores do the same thing, but asterisks are safer because underscores are ignored in the middle of a word by most parsers.
What is the difference between asterisks and underscores?
They render identically at the start of a word. Inside a word they differ: asterisks still work, while underscores are deliberately ignored so that variable_names_like_this are not mangled into italics.
How do I make text both bold and italic?
Use three asterisks around it. You can also nest one inside the other, which is clearer when only part of a bold phrase should also be italic.
Why is my text not turning bold?
Almost always a space problem. The markers must sit flush against the text, so ** bold ** renders as literal asterisks while **bold** works. An unclosed pair leaves the markers visible too.
How do I show a literal asterisk?
Escape it with a backslash (\*) or wrap the text in a code span, where Markdown syntax is not interpreted at all.

Sources