Skip to content

How to Make Text Bold in HTML

Short answer: wrap the text in <strong> when it’s important, like <strong>Warning:</strong>, or in <b> when it should only look bold, like a product name. Both show bold text. With CSS, use font-weight: bold (the same as 700). Every example below is live: edit the code and the preview changes.

The quick answer

You can get bold text three ways. With the browser’s default styles they all look the same:

strong, b and font-weight
  • <strong>: the text is important, serious or urgent. A warning, a deadline, the one step people mustn’t skip.
  • <b>: you want the text to stand out, but it isn’t more important than the rest. Key words, product names, the name of a button.
  • CSS font-weight: bold as part of the design, like prices, labels or a whole menu. It also lets you pick how bold: 600, 700, 800 and so on.

The examples run in a locked box: scripts are off, nothing is sent anywhere, and your edits go away when you reload. To keep one, copy it into the HTML Editor.

<b> vs <strong>

By default they look exactly alike. The difference is what they mean. <strong> says “this matters more than the text around it”. <b> only says “draw the eye here”, with no extra importance. That meaning lives in the HTML, not in the styles, so it stays when the look changes, for example after a redesign.

strong for importance, b for attention
TagMeansGood for
<strong> Strong importance, seriousness or urgency Warnings, deadlines, “don’t do this” steps
<b> Bring attention to this text, nothing more Key words, product names, names of buttons and menus

What about screen readers? It’s tempting to say they read <strong> louder, but with their default settings most of them read both tags just like normal text. Some can be set to announce emphasis. So pick the tag for its meaning, and if a warning really must be heard, say it in words too (“Warning:”). Both tags are valid HTML. <b> isn’t deprecated, it just has a narrower job than it had in the 1990s.

Bold one word

<b> and <strong> are inline tags, so you can put them around a single word, a few words, or even part of a word, right in the middle of a sentence. The line doesn’t break around them.

One word, a few words, part of a word

Keep the spaces outside the tag: reply <strong>by Friday</strong>, rather than reply<strong> by Friday </strong>,. The second one leaves a space before the comma (“by Friday ,”), and it’s harder to read and edit. Writing in a text editor instead? Our Text to HTML editor has a Bold button (or press Ctrl+B) and gives you the <strong> tags to copy.

CSS font-weight: bold, 700 and friends

The CSS property for bold is font-weight. It takes a keyword or a number. The numbers go in steps of 100 from 100 (thinnest) to 900 (heaviest). normal is 400 and bold is 700, so font-weight: bold and font-weight: 700 do the same thing.

Every weight from 100 to 900
normal, bold, bolder and lighter
ValueCommon nameNotes
100ThinAlso called Hairline.
200Extra Light
300Light
400Normal, RegularSame as normal. Body text.
500Medium
600Semi BoldPopular for buttons and labels.
700BoldSame as bold. Headings use it; b and strong get it in normal text.
800Extra Bold
900BlackAlso called Heavy.

bolder and lighter are relative: they look at the parent’s weight. Inside normal text (400), bolder gives 700. Inside a heading that’s already 700, it gives 900, and lighter gives 400. That’s also how <b> and <strong> work: the browser gives them font-weight: bolder, so a <strong> inside a heading asks for 900.

The font family and size are set with other properties. See the font and font size tutorial for those, and the text color tutorial to change the color.

Why 600 looks like 700 (or 400)

A font is really a set of files, one per weight (and style). Many fonts only come with two: regular (400) and bold (700). When you ask for a weight the font doesn’t have, the browser picks the closest one it has, by a fixed rule:

  • 600 and up: the nearest heavier weight, or the nearest lighter one if there’s none. So 600 shows as 700.
  • 400 and 500: a weight up to 500 if there is one, then lighter ones, then heavier ones. So 500 shows as 400.
  • Below 400: the nearest lighter weight, or the nearest heavier one. So 300 shows as 400 when there’s nothing lighter.
Georgia only has a regular and a bold face

That’s why the 100 to 900 example above may show only two or three different weights on your screen: it depends on which weights of the font your device has. If you need a real 600, load a font that includes a 600 face (a web font from a font service, or your own font files with @font-face).

And if a font has no bold face at all, the browser fakes one by drawing the regular letters a little thicker. This “faux bold” often looks smudged. You can switch it off with font-synthesis-weight: none (or font-synthesis: none, which also stops fake italics), but then that text simply isn’t bold, so the better fix is to load the bold face.

💡 Variable fonts are one file that holds every weight in a range, often 100 to 900. With one of those, any number works, not only the hundreds: font-weight: 650 gives you something between semi bold and bold. CSS accepts any number from 1 to 1000, but with a normal font it gets matched to the nearest weight the font has.

A class or a style attribute?

For a one-off, a style attribute is quick: <span style="font-weight: 700;">. When the same kind of text shows up again and again, like prices, give it a class and set the weight once in a stylesheet. Change the rule and every price follows.

A class for every price, a style for one

Try changing 700 to 400 in the .price rule: both coffee prices change, the tea price doesn’t. A <span> with bold CSS works like <b>: it only changes the look. If the text is important, use <strong> and style that instead.

Make bold text not bold

Headings (<h1> to <h6>) and table header cells (<th>) are bold by default, and so are <b> and <strong>. To take that away, set font-weight: normal (or 400) on them. Keep the tag, though: a heading is still a heading for screen readers and search engines, even when it isn’t bold.

A heading and th that aren’t bold
strong shown another way

The second example keeps <strong> for its meaning but shows it with a yellow background instead of bold. That’s handy when your font’s bold face looks too heavy, or when the design wants a highlight.

Bold links, buttons and table rows

Links and buttons aren’t bold by default. Add font-weight: 700 to make them bold. There’s one catch with buttons: form controls like <button>, <input> and <select> don’t take the font from the text around them. Set font-weight on the button itself, or give buttons font: inherit so they match their surroundings.

A bold link, and a button that doesn’t inherit
A bold total row

For a table, use <th> for real header cells (they’re bold already), and a class like .total for a row that should only look heavier, like the total on a receipt. To build a table without typing the tags, try the HTML Table Generator.

Use bold with care

Bold works because it’s rare. When a whole paragraph is bold, nothing stands out any more, and long bold text is harder to read. Save it for the few words people mustn’t miss.

A bold paragraph vs one bold phrase
Thin gray text vs normal text
  • Use real headings. A bold <p> looks like a heading, but it isn’t one. Screen reader users often jump from heading to heading to find their way around a page, and a bold paragraph doesn’t show up in that list. Use <h2>, <h3> and so on, and style them however you like.
  • Watch thin, light text. Weights like 100 to 300 have thin strokes, and in light gray they get hard to read quickly. Check the color with the Color Contrast Checker. Bold text counts as large text in the contrast rules from about 19px (24px when it isn’t bold), so it may pass at 3:1 instead of 4.5:1.

Questions people ask

How do I make text bold in HTML?

Wrap it in <strong> or <b>: <p><strong>Warning:</strong> the oven is hot.</p>. Both show bold text. With CSS, use font-weight: bold (or 700), for example <span style="font-weight: bold;">Bold</span>, or a class like .price { font-weight: 700; }.

What is the difference between <b> and <strong>?

They look the same by default. <strong> means the text is important, serious or urgent, like a warning. <b> only draws attention to the text without making it more important, like a product name or the name of a button. Pick the one that matches what you mean.

Is the <b> tag deprecated?

No. <b> is valid HTML5. Its job is narrower than it used to be: use it for text that should stand out without being more important. For important text, use <strong>. For bold as part of the design, like prices or menus, use CSS font-weight.

Do screen readers read <strong> differently?

With their default settings, most screen readers read <strong> and <b> like normal text. Some can be set to announce emphasis. So if something really must be noticed, say it in words too, like "Warning:" or "Required", instead of relying on bold alone.

What is the CSS for bold text?

font-weight: bold, which is the same as font-weight: 700. normal is 400. You can also use numbers in steps of 100 from 100 (thin) to 900 (black), like 600 for semi bold, or bolder and lighter, which pick a heavier or lighter weight than the parent text (in normal text, bolder gives 700; in a bold heading it gives 900).

Why does font-weight 600 look the same as 700?

Your font probably has no 600 face. Many fonts only come in regular (400) and bold (700), and the browser uses the closest weight it has: 600 and up go to the next heavier weight, so 600 shows as 700, and 500 shows as 400. To get a real 600, load a font that includes that weight, or a variable font.

How do I make a heading not bold?

Set font-weight: normal (or 400) on it, for example h2 { font-weight: normal; }. The same works for table header cells (th) and for <b> and <strong>. Keep the heading tag, because screen reader users and search engines still rely on it even when it is not bold.

Why is my button not bold when the text around it is?

Buttons, inputs and selects do not take the font from the text around them. Put font-weight: 700 on the button itself, or give buttons font: inherit so they use the same font, size and weight as their surroundings.

How do I bold just one word in a sentence?

Wrap only that word: Please reply <strong>by Friday</strong>, thanks. <b> and <strong> are inline, so the line does not break around them, and they even work on part of a word. Keep the spaces outside the tag so the code is easy to read.

Keep going