Support0

CSS font-weight playground

Explore font-weight with controls for comparing absolute keywords, relative keywords, and numeric weights on a real text block.

Ask AI

CSS font-weight playground

Response generated with openai/gpt-5.4-nano. AI can make mistakes. Always review the result.

BaselineLab lets you compare font-weight with real text, numeric weights, absolute keywords and relative values before copying the CSS. Fonts with a variable weight axis support intermediate values within their range; others match an available face.

HTML
<p class="font-weight-sample">
  BaselineLab lets you compare font-weight with real text,
  numeric weights, absolute keywords and relative values before copying the CSS.
  Fonts with a variable weight axis support intermediate values within their range; others match an available face.
</p>
Tailwind CSS
Examples for Tailwind CSS 4.3 with the default theme. Custom values keep arbitrary classes when there is no equivalent utility. Changing the theme can change utility values.
<p class="max-w-xl text-2xl leading-snug font-bold">
  BaselineLab lets you compare font-weight with real text,
  numeric weights, absolute keywords and relative values before copying the CSS.
  Fonts with a variable weight axis support intermediate values within their range; others match an available face.
</p>
CSS
.font-weight-sample {
  max-inline-size: 36rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
}

Educational guide to font-weight

From the requested weight to the font that draws it

Compare absolute and relative weights, face matching, variable fonts and synthetic bold. A different number does not guarantee a different outline.

Mental model

font-weight requests a thickness within a family. The browser computes the inherited or relative value, matches a compatible face and may synthesize missing bold. The family, loaded resources and available glyphs determine the result.

  1. Request a weight

    normal, bold, a number or a value relative to the parent.

  2. Match a face

    Resolve the weight among available faces or a variable range.

  3. Draw the text

    Use the selected glyphs, any necessary fallback and permitted synthesis.

From declaration to glyphsStatic diagram. The computed value is not a report of the rendered face: two different numbers can end up using the same resource.

Numbers and absolute keywords

normal equals 400 and bold equals 700. Unitless numbers accept values from 1 to 1000, including decimals; they are neither percentages nor limited to multiples of a hundred. Their visible availability depends on the font.

The same text, five requests

font-weight: normal

Aa · Weight changes the strokes of text.

font-weight: 400

Aa · Weight changes the strokes of text.

font-weight: bold

Aa · Weight changes the strokes of text.

font-weight: 700

Aa · Weight changes the strokes of text.

font-weight: 550

Aa · Weight changes the strokes of text.

normal and 400 request the same weight; so do bold and 700. The 550 row keeps that request even if Georgia or its fallback has no exact face for it. Size and line height stay the same throughout the comparison.
The same text, five requests
<div class="font-weight-guide-values">
  <div>
    <p class="label">font-weight: normal</p>
    <p class="sample weight-0">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: 400</p>
    <p class="sample weight-1">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: bold</p>
    <p class="sample weight-2">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: 700</p>
    <p class="sample weight-3">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: 550</p>
    <p class="sample weight-4">Aa · Weight changes the strokes of text.</p>
  </div>
</div>
.font-weight-guide-values {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
  }

  .sample {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.6;
  }

  .weight-0 {
    font-weight: normal;
  }

  .weight-1 {
    font-weight: 400;
  }

  .weight-2 {
    font-weight: bold;
  }

  .weight-3 {
    font-weight: 700;
  }

  .weight-4 {
    font-weight: 550;
  }
}

The property is inherited and its initial value is normal. Changing weight does not change font-size, but it can change widths, wrapping and metrics. Use strong for semantic importance and em for emphasis; applying font-weight alone adds neither meaning.

Inheritance, bolder and lighter

bolder does not add 100 or find the next file. It resolves from the parent’s computed weight using reference steps 100, 400, 700 and 900; available face matching happens afterwards. lighter follows its own mapping.

Two parents and their descendants

font-weight: 400

Inherited · Aa · Weight changes the strokes of text.

bolder · Aa · Weight changes the strokes of text.

lighter · Aa · Weight changes the strokes of text.

font-weight: 600

Inherited · Aa · Weight changes the strokes of text.

bolder · Aa · Weight changes the strokes of text.

lighter · Aa · Weight changes the strokes of text.

With a 400 parent, children compute 400 through inheritance, 700 with bolder and 100 with lighter. With a 600 parent they compute 600, 900 and 400. Different numbers do not require six different outlines.
Two parents and their descendants
<div class="font-weight-guide-relative">
  <div class="parent-400">
    <p class="label">font-weight: 400</p>
    <p class="sample">Inherited · Aa · Weight changes the strokes of text.</p>
    <p class="sample heavier">bolder · Aa · Weight changes the strokes of text.</p>
    <p class="sample lighter">lighter · Aa · Weight changes the strokes of text.</p>
  </div>
  <div class="parent-600">
    <p class="label">font-weight: 600</p>
    <p class="sample">Inherited · Aa · Weight changes the strokes of text.</p>
    <p class="sample heavier">bolder · Aa · Weight changes the strokes of text.</p>
    <p class="sample lighter">lighter · Aa · Weight changes the strokes of text.</p>
  </div>
</div>
.font-weight-guide-relative {
  display: grid;
  gap: 1.5rem;
  font-family: Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.6;
  overflow-wrap: anywhere;

  .parent-400 {
    font-weight: 400;
  }

  .parent-600 {
    font-weight: 600;
  }

  .label {
    margin-block: 0 0.5rem;
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 400;
  }

  .sample {
    margin-block: 0 0.5rem;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  .heavier {
    font-weight: bolder;
  }

  .lighter {
    font-weight: lighter;
  }
}

For parents from 350 to below 550, bolder gives 700 and lighter 100; from 550 to below 750 they give 900 and 400. At the extremes the step is limited: from 900 upwards, bolder keeps the value; below 100, lighter keeps it. Use inherit to repeat the parent’s weight and a number when you need a precise target.

When the requested weight is missing

Matching is not a simple numeric distance. The browser first tries the exact weight within the family and faces compatible with style and width. If none exists, the matching algorithm has a defined search order.

A local family with 400 and 700 faces

font-weight: 400

Aa · Weight changes the strokes of text.

font-weight: 500

Aa · Weight changes the strokes of text.

font-weight: 550

Aa · Weight changes the strokes of text.

font-weight: 700

Aa · Weight changes the strokes of text.

If the local names Georgia and Georgia-Bold are available, 400 and 500 use the regular face; 550 and 700 use bold. Synthesis is disabled to compare face selection rather than artificial thickening.
A local family with 400 and 700 faces
<div class="font-weight-guide-matching">
  <div>
    <p class="label">font-weight: 400</p>
    <p class="sample weight-400">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: 500</p>
    <p class="sample weight-500">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: 550</p>
    <p class="sample weight-550">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">font-weight: 700</p>
    <p class="sample weight-700">Aa · Weight changes the strokes of text.</p>
  </div>
</div>
@font-face {
  font-family: "WeightGuideStatic";
  src: local("Georgia");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "WeightGuideStatic";
  src: local("Georgia-Bold");
  font-style: normal;
  font-weight: 700;
}

.font-weight-guide-matching {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
  }

  .sample {
    margin: 0;
    font-family: "WeightGuideStatic", serif;
    font-size: 1.25rem;
    line-height: 1.6;
    font-synthesis: none;
  }

  .weight-400 {
    font-weight: 400;
  }

  .weight-500 {
    font-weight: 500;
  }

  .weight-550 {
    font-weight: 550;
  }

  .weight-700 {
    font-weight: 700;
  }
}

From 400 to 500 inclusive, search upwards through 500, then below the target, and finally above 500. Below 400, lower weights are tried first; above 500, higher weights first. The computed value keeps the numeric target even when a different face represents it.

These aliases use local(), without font downloads. If the device lacks those names or blocks local font access, serif is used and the controlled comparison is no longer guaranteed. Inspect the browser’s rendered fonts: CSS.supports and getComputedStyle alone do not identify the resource used. A missing weight does not require moving to the next family; a missing glyph may require fallback.

Variable fonts and the wght axis

A variable font with a wght axis can offer intermediate weights within its range. Not every variable font includes that axis or covers 1–1000. Declaring a range in @font-face tells the browser what the file offers; it does not turn a static font into a variable one.

Reference recipe · requires your variable font file

Reference recipe · requires your variable font file
<p class="font-weight-guide-variable">Aa · Weight changes the strokes of text.</p>
@font-face {
  font-family: "ExampleVariable";
  src: url("/fonts/example-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

.font-weight-guide-variable {
  font-family: "ExampleVariable", sans-serif;
  font-size: 1.25rem;
  font-weight: 625;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

This code does not run in the guide: replace the URL with a real file offering a wght axis and a 100–900 range, or adapt the descriptor to its actual range. The paragraph property requests one weight, 625; the @font-face descriptor announces a range with two numbers. For static files, declare each face separately with its correct weight, as in the previous comparison.

Prefer font-weight for the registered wght axis. A font-variation-settings declaration containing "wght" can impose that axis and override the high-level weight. Check that property, the descriptors and the loaded file before blaming an unchanged sample on missing support. Weight changes may affect layout; constant width is not promised.

Real bold versus synthesis

A designed bold face and artificial thickening are not equivalent. Allowing synthesis does not force it: if an appropriate face exists, the browser can use it. Disabling synthesis does not download or create a missing weight either.

One regular face, two permissions

Weight synthesis allowed

Aa · Weight changes the strokes of text.

Synthesis disabled

Aa · Weight changes the strokes of text.

The local alias advertises only Georgia regular 400, but both rows request 700. The first permits weight synthesis; the second prohibits it. If the local resource is available, the browser may thicken the first and keeps the regular face without synthesis in the second.
One regular face, two permissions
<div class="font-weight-guide-synthesis">
  <div>
    <p class="label">Weight synthesis allowed</p>
    <p class="sample">Aa · Weight changes the strokes of text.</p>
  </div>
  <div>
    <p class="label">Synthesis disabled</p>
    <p class="sample no-synthesis">Aa · Weight changes the strokes of text.</p>
  </div>
</div>
@font-face {
  font-family: "WeightGuideRegularOnly";
  src: local("Georgia");
  font-style: normal;
  font-weight: 400;
}

.font-weight-guide-synthesis {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
  }

  .sample {
    margin: 0;
    font-family: "WeightGuideRegularOnly", serif;
    font-size: 1.25rem;
    font-weight: 700;
    font-synthesis: weight;
    line-height: 1.6;
  }

  .no-synthesis {
    font-synthesis: none;
  }
}

font-synthesis: none disables all forms of synthesis and font-synthesis: weight allows only weight synthesis. To change just that permission while preserving the others, use font-synthesis-weight: none or auto and check its support separately. Do not disable synthesis globally without checking whether important content distinctions disappear.

Very thin weights can lose legibility even when their color meets the required contrast ratio. Check size, contrast, fallback, accents and text resizing to 200%. Preserve content and focus when lines rewrap; a heavy weight does not guarantee accessibility or change HTML semantics on its own.

Common mistakes

500 and 400 look identical

Expected result
Understand which weight is being represented.
Cause
The family does not offer both weights and matching selects the same face, or a low-level wght setting fixes the axis.
Solution
Inspect the rendered face and active rules. Load distinct faces or a variable font with the right range; do not infer the face from the computed value.

bolder does not produce 600

Expected result
Give the descendant a specific weight.
Cause
bolder has been interpreted as adding 100 to 500.
Solution
bolder from 500 computes 700. Declare 600 if that is the target and check how the family resolves it.

Bold does not match the design

Expected result
Use the intended bold face.
Cause
Only regular is loaded, descriptors do not match the file or the browser is synthesizing thickness.
Solution
Check loading and descriptors for each face. Use a real bold face or a correct variable range and decide whether to allow synthesis for that content.

Support and compatibility

Web Platform DX classifies font-weight as Baseline Widely Available. That status describes the platform feature; it does not establish whether a family is installed, loaded or offers the requested weight.

MDN BCD separates common numbers from extended numeric syntax 1–1000, recorded since Chrome 62, Firefox 61 and Safari 11. Variable fonts and range descriptors need their own checks. Support for font-synthesis-weight is independent of font-weight and the font-synthesis shorthand.

The four scenes apply native CSS without JavaScript emulation. In older browsers, keep normal or bold as a preceding declaration if you need a fallback for extended numbers. A syntax check does not certify visual differences, available fonts, synthesis or accessibility. The variable recipe is not presented as a verified preview.