CSS / Reference / font-weight: Numeric Weights, Relative Weights, and Font Matching
CSS font-weight requests how heavy text should appear. normal corresponds to 400 and bold to 700. With the same request of 650, a static family that supplies only 400 and 700 can use its 700 face, while a variable font with a suitable range can render an intermediate weight.
Weight values and what they request
The initial value is normal. An element inherits its parent’s computed weight unless another declaration applies. Browser styles can also specify a weight on some HTML elements. Use a number when you need an explicit request.
| Value | Behavior |
|---|---|
normal / 400 |
Requests the normal weight of 400. |
bold / 700 |
Requests the bold weight of 700. |
1–1000 |
Accepts numbers from 1 through 1000, including fractions such as 650.5. The font may supply only some weights. |
bolder / lighter |
Uses the inherited weight to calculate a relative weight according to defined steps. |
The W3C font-weight specification defines the range, inheritance, and relative keywords.
Compare 650 in a static and a variable font
Save the complete code as font-weight-example.html in UTF-8 and open it in a browser. It uses the same Latin text in both samples. The static sample uses locally installed Georgia Regular and Georgia Bold. The variable sample uses locally installed Bahnschrift. Both request 650.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Compare CSS font weights</title>
<style>
@font-face {
font-family: "Demo Static";
src: local("Georgia");
font-weight: 400;
}
@font-face {
font-family: "Demo Static";
src: local("Georgia Bold");
font-weight: 700;
}
@font-face {
font-family: "Demo Variable";
src: local("Bahnschrift");
font-weight: 300 700;
}
body { margin: 0; color: #20242b; background: #fff; font: 1rem/1.5 system-ui, sans-serif; }
main { max-width: 44rem; margin: auto; padding: 1rem; overflow-wrap: anywhere; }
h1 { font-size: 1.4rem; }
.samples { font-weight: 400; }
.weight { margin: .2rem 0 1rem; font-size: 30px; font-weight: 650; }
.static { font-family: "Demo Static", serif; }
.variable { font-family: "Demo Variable", sans-serif; }
</style>
</head>
<body>
<main>
<h1>Compare CSS font weights</h1>
<section class="samples">
<h2>Static font · Georgia</h2>
<p class="weight static">Font weight in CSS</p>
<h2>Variable font · Bahnschrift</h2>
<p class="weight variable">Font weight in CSS</p>
</section>
</main>
</body>
</html>
The first sample registers Georgia at 400 and 700 only. Computed still shows 650, but the rendered face is Georgia Bold. Change the shared .weight rule to 400, 500, 650, and 700 in turn. In this example, 400 and 500 use the regular face, while 650 and 700 use the bold face.
Bahnschrift supports weights from 300 to 700 on its wght axis. On the second line, the same font file can produce different weights at 650 and 700. Compare them one at a time and restore 650 when you finish.
A local() source uses a font installed on your device. If the font is absent or the browser restricts local font access, a fallback can change the result. Check the rendered font before interpreting the comparison.
Declare the weights a web font supports
When serving a variable web font, set the font-weight descriptor in @font-face to the range the file supports. Here is a rule for a web font file whose range is 300–700.
@font-face {
font-family: "Site Variable";
src: url("./site-variable.woff2") format("woff2");
font-weight: 300 700;
}
.title {
font-family: "Site Variable", sans-serif;
font-weight: 650;
}
Replace the example path with the path to your file relative to the stylesheet and apply .title to a heading. For static files, use separate @font-face rules with the same family name and the exact weight for each file, such as 400 and 700.
If a variable font does not change weight, check the declared range against the file’s range. If font-variation-settings fixes "wght" to a single value, disable that setting and vary only font-weight.
How bolder and lighter are calculated
bolder and lighter use predefined steps. For example, bolder gives 700 from a parent at 400, or 900 from a parent at 600. The table shows computed results for representative parent weights.
| Computed parent weight | bolder |
lighter |
|---|---|---|
| 100 | 400 | 100 |
| 400 | 700 | 100 |
| 600 | 900 | 400 |
| 700 | 900 | 400 |
| 900 | 900 | 700 |
Keep .samples at 400 and apply font-weight: bolder to the first sample in developer tools. Computed shows 700. Try lighter to get 100. If no 100 face is available, the browser can render a different available weight. Restore 650 after testing.
Why different numbers can look the same
- Select the text in developer tools.
font-weightin Computed shows the request. Rendered Fonts identifies the faces that drew the text. The panel names can differ between browsers. - If 500 and 650 look unexpected, check which weights the family supplies, the
@font-facedescriptors, and the network response. Mixed scripts can use different fonts for individual characters. - If the computed weight itself differs, inspect the cascade. A later shorthand such as
font: 1rem serifcan reset the weight tonormalbecause it provides no weight.
A browser can synthesize a heavier appearance when a real bold face is missing. Use font-synthesis-weight: none to disable that effect. Available bold faces can still match. See the W3C font-synthesis-weight specification for details.
Use the HTML strong element for content of particular importance. CSS controls how bold it appears, while the HTML carries its meaning.
See the CSS typography guide to coordinate families, sizes, and weights. Use font-family to set the fallback order.




