Markdown · <code>*text*</code> or <code>_text_</code>
Emphasis
Asterisks and underscores mark italic and bold text, with rules about word boundaries.
Key facts
| Italic | <code>*text*</code> or <code>_text_</code> |
|---|---|
| Bold | <code>**text**</code> or <code>__text__</code> |
| Both | <code>***text***</code> |
| Underscore rule | Does not work inside words |
| Escape | <code>\*</code> for a literal asterisk |
| Standard | CommonMark §6.2 |
Two delimiter characters
A single asterisk or underscore produces emphasis (italic); a double pair produces strong emphasis (bold). Three combine both. The delimiters must open and close around non-space text, and the opening and closing runs must match in a way the parser can resolve.
Underscores are stricter: they do not create emphasis inside a word. snake_case_name stays literal, while snake*case*name would emphasize part of the word. That is why documentation often prefers asterisks.
Nesting and escapes
Emphasis can nest, but mixing delimiters is where parsers disagree. **bold and *italic* together** is widely supported; more complex combinations can produce surprising output. Keep nesting simple and preview the result.
To show a literal asterisk, escape it with a backslash or wrap it in code. Inside code spans, emphasis syntax is not processed at all, which is the reliable way to display markup.
Frequently asked questions
Why does _not work_ inside a word?
CommonMark forbids intraword underscore emphasis to protect identifiers such as snake_case names.
Is ***text*** bold italic?
Yes, in CommonMark and GFM. It combines strong and emphasis.