Markdown Editor Bold: How to Make Text Stand Out in Markdown

Bold text is the first Markdown command most people learn, and the one that produces the most confusing previews. Two different syntaxes do the same job, the underscores version behaves differently in the middle of a word, and a single stray space can leave the asterisks visible on the page. This guide walks through the syntax rules that GFM actually applies, the Bold button in the editor's toolbar, nesting inside tables and lists, and what happens to bold text on the five export paths. Everything runs in the browser, so you can keep a draft open and test each example as you read.

The Two Ways to Write Bold in Markdown

Markdown has two equivalent markers for strong emphasis: **text** and __text__. Both produce the same rendered result in GitHub-flavored Markdown, which is the dialect this editor renders, and both work inline, in the middle of a sentence, without breaking the paragraph around them.

This is **bold with asterisks** inside a sentence.
This is __bold with underscores__ inside a sentence.

The asterisk form is the safer habit. Underscores are also the marker for italic (_text_), so a document that mixes __ and _ in the same word forces the parser to make decisions you probably did not intend. The underscore form also stops working when the markers sit inside a word: GFM intentionally refuses to parse snake__case__word as bold, because programmers kept losing identifiers in plain text.

Which form should you type? Either, as long as it is consistent. Most style guides for Markdown documents standardize on the asterisk form because it never collides with word-internal underscores. The sample document that ships with the editor uses both deliberately, including a line with bold wrapping nested italic: **bold with _nested italic_** renders with the inner words italicized and the rest weighted.

There is no third mode. Raw HTML <strong> tags also render, because the pipeline passes raw HTML through, but writing tags defeats the point of Markdown and makes the source harder to scan. Reach for <strong> only when a tool downstream of your document demands it.

The Bold Button and the Selection

The toolbar has ten commands, and Bold is the first. Under the hood the button wraps the current selection with ** on both sides. Two behaviors follow from that, and they match how desktop editors work.

With text selected, the button puts the opening ** before the selection and the closing ** after it, leaving the words in place. Press it again on the same text and the markers are not automatically removed; you delete them by hand or undo the action, which is worth knowing before you start toggling in a long paragraph.

With nothing selected, the button inserts the literal placeholder word bold text between the markers, with the placeholder selected so you can type over it immediately. On a phone, where selecting a few words precisely is fiddly, this path is faster than trying to hit the exact characters before tapping the icon.

The Bold command works in all three view modes. In Editor view you see the markers appear in the source. In Split view the preview pane repaints on every keystroke, so the weighted text appears the moment the closing marker lands. In Preview-only view the toolbar still edits the source underneath, so the visible page flips from normal to bold without any save step. The character, word and line counters under the editor update with every insertion, which makes them a quick sanity check that the command landed where you expected.

Bold Inside Tables, Lists and Headings

Inline emphasis composes with every block construct the editor renders, with a few practical notes.

Inside a GFM table, bold applies per cell. The markers go around the words, not around the pipes, and the table keeps its column alignment:

| Syntax | Result |
|--------|--------|
| **asterisks** | bold |
| __underscores__ | bold |

In list items, bold wraps naturally: - **Step one:** open the sample renders a bold lead-in followed by normal text, a pattern that reads well in checklists and task lists, since the [ ] and [x] boxes are parsed independently of the emphasis around them.

Headings can contain bold, but the heading styles are already heavier than body text, so the visual gain is close to zero. The one place it earns its keep is a mixed heading like ## Part one: **the syntax rules**, where bold marks the part that matters. Keep that trick rare; a page whose headings argue with themselves is harder to scan, not easier.

Block quotes accept bold exactly like paragraphs. Links accept it in two positions: **[label](url)** makes the whole link bold, while [**label**](url) makes the label bold but leaves any trailing text at normal weight. If a link sits inside a sentence, the second form usually looks better.

Nesting and Mixing: What Actually Renders

Most bold bugs are syntax collisions rather than editor bugs. The table below lists the cases worth memorizing, taken from the parser behavior of the editor's remark and rehype pipeline.

You typeWhat rendersWhy
**bold**bold textStandard strong emphasis
__bold__bold textUnderscore variant, same output
**bold with _italic_**bold with italic insideNested emphasis parses fine
***both***bold and italicTriple markers combine both
** spaced **literal asterisksSpaces inside the markers block parsing
snake__case__wordunchanged textUnderscores inside a word are literal
\*\*escaped\*\***escaped**Backslashes escape the markers

The spacing rule catches more people than any other: ** bold ** is not bold, because GFM requires the opening delimiter to be followed directly by non-space content. The fix is to close the gap on both sides. The word-internal rule explains the other classic failure, where __init__ renders untouched even though the same pair of underscores around a whole word works perfectly.

Combining markers is safe as long as the pairs match. ***both*** is bold plus italic in one span; **bold with _italic_ inside** nests cleanly because each pair closes in order. Where it breaks is mismatched pairs, **open_ and similar typos, which leave everything downstream looking like the markers never closed. When a whole paragraph turns bold and you cannot see why, search upward for an unclosed **.

Bold in Math, Diagrams and Code

The editor draws math with KaTeX and renders diagram blocks as live SVG, and bold means something different in each of those regions.

In code, markers stay literal. A fenced block tagged with a language, or even a plain fenced block, shows **this** as typed; emphasis is not parsed inside code, by design. This is the correct behavior, because code that silently changed weight would be a bug report of its own. If you want to show Markdown syntax in a tutorial, fencing it is the reliable way to keep the asterisks visible.

In math, bold comes from LaTeX, not from Markdown. Inside $$ ... $$, \mathbf{x} gives a bold vector, and surrounding the whole expression with asterisks does nothing useful. The editor renders KaTeX on every keystroke, so you can type $$\mathbf{w} = 2\mathbf{v}$$ and watch the bold symbols update live.

Diagram blocks (mermaid, flowchart, chart, graphviz and the rest) take their styling from the diagram language itself. Mermaid labels go bold with **text** inside the label string, Graphviz with font attributes. Markdown emphasis outside the fence does not leak into the diagram body, and that separation is what keeps the rendered output stable across exports.

When Bold Refuses to Render

Five failure modes account for nearly every "the bold is not working" report. Check them in this order.

The markers touch a space. ** text** and **text ** both fail. The delimiters must sit flush against the words.

The pair does not match. An opening ** closed by _ or by a single * produces literal markers. Count the closing pair before assuming the parser is broken.

Underscores sit inside a word. Covered above: __bold__ works, snake__case__ does not. Switch to asterisks when the bold starts mid-word.

The asterisks are escaped. A backslash before a marker makes it literal, which is what you want when documenting syntax and the opposite of what you want in prose. A document pasted from a code tutorial often carries these escapes; remove the backslashes.

The line breaks inside the pair. An empty line between **open and close** ends the paragraph, and emphasis cannot span paragraphs. Keep the pair on one logical block.

One environment note: the preview pane repaints on every keystroke, so you never need to save or refresh to see the result. If the preview lags on a very long document, switching to Editor view and back forces a fresh paint without touching the text.

What Survives Export

The editor offers five export paths, and they split into two groups: paths that carry the rendered formatting, and paths that carry the Markdown source as plain text.

The formatted group first. Copy HTML takes the rendered innerHTML of the preview pane, so bold arrives as real <strong> elements and pastes with the weight intact. The PNG export renders the preview pane to a canvas, which is a pixel-accurate image of the page: bold, tables and code all look exactly as they did on screen.

The source-text group covers .md, PDF and DOCX. Download .md saves the document with the markers exactly as typed, which is right for a file you will edit again later. The PDF and DOCX exports also start from the Markdown source: the PDF lays the raw text out line by line on A4 pages, and the DOCX converts every line into a paragraph, giving heading lines real heading styles but leaving inline markers untouched. The practical result is that **bold** shows up in those two files with the asterisks visible, not as weighted text. The ZIP bundle packages the .md source together with a PDF built the same way.

If a weighted PDF or Word file is the goal, export PNG for the visual copy or use Copy HTML and paste into the target tool; keep the .md as the master source, since the markers travel with it and can be re-rendered anywhere.

Frequently Asked Questions

How do I make text bold in Markdown?

Wrap the word or phrase in two asterisks, **like this**, or two underscores, __like this__. Both render identically. The asterisk form is safer because it never collides with underscores used inside words.

Is ** or __ better for bold?

Asterisks work everywhere, including the middle of a word and next to italic markers. Underscores are fine around whole words but silently fail in cases like snake__case__, so most writers standardize on **.

Why is my bold not showing in the preview?

The usual causes are a space between the markers and the text, a mismatched closing pair, or escaped asterisks copied from a code example. Fix the spacing first, then count the closing markers.

Can I bold text inside a table cell?

Yes. Put the markers around the cell content, not around the pipes. Column alignment is unaffected, and the emphasis carries through every export path, including PDF and DOCX.

Does bold carry over to PDF and DOCX exports?

No. The PDF and DOCX exports write the raw Markdown text, so the asterisks stay visible and the weight is not applied. The PNG export and Copy HTML carry the rendered formatting; use one of those when the bold must show.

Can I use HTML strong tags instead of Markdown?

The pipeline passes raw HTML through, so <strong> renders. It is not recommended for everyday writing because tags clutter the source, but it is handy when a downstream tool expects real HTML elements.

topheman
topheman

Paris, France · SO reputation 7992 · Badges: 5🥇26🥈33🥉 · SO member since 2013