w:b (Bold)
Applies bold formatting to the text of the run.
Parent elements
Description
w:b applies bold formatting to all text in the run. It is an on/off toggle property defined in ECMA-376 Part 1 §17.3.2.1.
When w:b is present with no w:val attribute, or with w:val="true", bold is active. Setting w:val="false" explicitly turns bold off — this is used in child styles to cancel bold inherited from a parent style (the toggle pattern).
The complex-script equivalent is w:bCs.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, 1, on (bold on) / false, 0, off (bold off). Omitting the attribute is equivalent to true. |
Toggles bold on or off. |
Examples
<!-- Bold text -->
<w:r>
<w:rPr>
<w:b/>
</w:rPr>
<w:t>Bold text</w:t>
</w:r>
new Run(
new RunProperties(new Bold()),
new Text("Bold text"));
<!-- Cancel inherited bold from parent style -->
<w:rPr>
<w:b w:val="false"/>
</w:rPr>
new RunProperties(
new Bold { Val = false }); // w:val="false" cancels bold
<!-- Bold text with complex script weight matched -->
<w:rPr>
<w:b/>
<w:bCs/> <!-- Complex script (Arabic/Hebrew) also bold -->
</w:rPr>
new RunProperties(
new Bold(),
new BoldComplexScript()); // Ensure RTL text is bold too
Emphasis Patterns
When to Use Bold
Semantic Uses:
- Keywords/Terms: Technical terms, glossary entries
- Labels: “Name:”, “Date:”, field identifiers
- Importance: Critical warnings, important points
- Navigation: Menu items, button labels
- Structure: Section headings (when style doesn’t include bold)
Bold Weight Behavior
<!-- Explicit bold font weight -->
<w:rPr>
<w:b/> <!-- Uses font's bold variant if available -->
<w:b w:val="true"/> <!-- Explicit on -->
</w:rPr>
<!-- Cancel inherited bold -->
<w:rPr>
<w:b w:val="false"/> <!-- Explicitly disable bold -->
</w:rPr>
Font Weight Increase: Bold typically increases perceived weight by 20-30%:
- Regular: 400 weight
- Bold: 700 weight (in CSS/OpenType terms)
- Very few fonts support intermediate weights; Word uses available bold variant
Complex Script Consideration
Always pair bold toggles with complex-script equivalents:
<!-- Latin + RTL consistent formatting -->
<w:rPr>
<w:b/> <!-- Latin bold -->
<w:bCs/> <!-- Complex script (Arabic/Hebrew) bold -->
</w:rPr>
Why: Some fonts render complex scripts differently; separate control ensures consistency.
Emphasis Layering
Safe Combinations:
- Bold + Regular:
<w:b/>(strong emphasis) - Bold + Italic:
<w:b/><w:i/>(maximum emphasis, use sparingly) - Bold + Underline:
<w:b/><w:u w:val="single"/>(strong + visual focus) - Regular + Italic:
<w:i/>(moderate emphasis, foreign words)
Avoid (hard to read):
- Bold + Italic + Underline (excessive)
- Bold + Color + Underline + Italic (visual noise)
Style Override Example
<!-- Paragraph styled with Bold Heading, but cancel for emphasis -->
<w:pPr>
<w:pStyle w:val="Heading1"/> <!-- Includes bold by default -->
</w:pPr>
<w:r>
<w:rPr>
<w:b w:val="false"/> <!-- Cancel inherited bold -->
</w:rPr>
<w:t>Not Bold Text in Heading</w:t>
</w:r>
Notes
- Toggle Pattern:
w:bis an on/off toggle; presence (orw:val="true") enables bold,w:val="false"disables. - Inheritance Cancellation: Use
<w:b w:val="false"/>to cancel bold inherited from parent style. - Boolean Values: Omit
w:valor usetrue/1/onto enable; usefalse/0/offto disable. - Complex Script: Always include
w:bCsfor runs with Arabic, Hebrew, or complex scripts. - Visual Emphasis: Bold increases font weight by ~20-30% depending on font.
- Semantic Use: Indicates importance, keywords, or emphasis.
- Accessibility: Screen readers may announce bold text; use sparingly for critical emphasis; prefer semantic markup (strong, emphasis elements in HTML).
- Print Rendering: Bold renders consistently across all printer types.
- Compatibility: Bold formatting is supported in all Office versions.
- Font Support: Not all fonts have bold variant; fallback to darker weight if unavailable.
- Readability: Excessive bold reduces readability; limit to <5% of body text.
- Semantic Overuse: Avoid bold for entire paragraphs; use for keywords only.