Support0

CSS font-stretch playground

Explore font-stretch with controls for testing typographic widths, keywords, and percentages on real text.

Ask AI

CSS font-stretch playground

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

WIDTH AXIS CSS FONT STRETCH Condensed and expanded faces only appear when the selected font provides them. Compare 75%, 100%, 125% and the named width keywords before copying the CSS.

HTML
<p class="font-stretch-sample">
  WIDTH AXIS CSS FONT STRETCH
  Condensed and expanded faces only appear when the selected font provides them.
  Compare 75%, 100%, 125% and the named width keywords before copying the CSS.
</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-inline-2xl [font-family:Avenir_Next,_Arial,_Helvetica,_sans-serif] text-3xl font-bold leading-[1.1] font-stretch-75%">
  WIDTH AXIS CSS FONT STRETCH
  Condensed and expanded faces only appear when the selected font provides them.
  Compare 75%, 100%, 125% and the named width keywords before copying the CSS.
</p>
CSS
.font-stretch-sample {
  max-inline-size: 42rem;
  font-family: "Avenir Next", Arial, Helvetica, sans-serif;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.1;
  font-stretch: 75%;
}

Educational guide to font-stretch

Choosing a typographic width, from condensed to expanded

Compare keywords, percentages and available faces. Connect font-stretch to font-width and the wdth axis, and distinguish typeface selection from visual scaling.

Mental model

font-stretch requests a width within a family. The browser seeks a face or a position on its variable axis. It does not automatically compress any font or change the container width: the family must offer that variation.

  1. Request a width

    A keyword or percentage relative to the font’s normal design.

  2. Match a face

    Resolve among available static widths or a variable range.

  3. Lay out the text

    Use the selected glyph metrics to distribute lines.

From the request to line breaksStatic diagram. The property keeps the requested value even when a different width represents it. Its percentage does not measure the space occupied by the paragraph.

Keywords and percentages

normal equals 100%, condensed 75% and expanded 125%. These request font width, not a percentage of the parent, font-size or container. The property is inherited and its initial value is normal.

Keywords and their equivalent values

font-stretch: condensed

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: 75%

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: normal

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: 100%

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: expanded

Aa · Designed widths change line breaks and preserve the shapes of letters.

The example family registers regular Arial and Arial Narrow. condensed/75% select the same width, as do normal/100%. expanded requests 125%, but without an expanded face it may use regular. Both local fonts must be available.
Keywords and their equivalent values
<div class="font-stretch-guide-values">
  <div>
    <p class="label">font-stretch: condensed</p>
    <p class="sample width-0">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: 75%</p>
    <p class="sample width-1">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: normal</p>
    <p class="sample width-2">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: 100%</p>
    <p class="sample width-3">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: expanded</p>
    <p class="sample width-4">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
</div>
@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialMT");
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
}

@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialNarrow");
  font-style: normal;
  font-weight: 400;
  font-stretch: condensed;
}

.font-stretch-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: "StretchGuideFaces", sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.6;
    font-synthesis: none;
  }

  .width-0 {
    font-stretch: condensed;
  }

  .width-1 {
    font-stretch: 75%;
  }

  .width-2 {
    font-stretch: normal;
  }

  .width-3 {
    font-stretch: 100%;
  }

  .width-4 {
    font-stretch: expanded;
  }
}

The keyword scale is ultra-condensed 50%, extra-condensed 62.5%, condensed 75%, semi-condensed 87.5%, normal 100%, semi-expanded 112.5%, expanded 125%, extra-expanded 150% and ultra-expanded 200%. These are design categories, not a promise to measure every phrase by that exact factor.

CSS Fonts accepts nonnegative percentages, including decimals. The playground’s 50–200% range and keyword scale are not the general syntax limit. An accepted value outside that range does not require the font to draw it either.

When a width is missing

Picking the nearest number is not enough. After seeking an exact match, requests up to 100% try narrower widths first, then wider ones; requests above 100% reverse that order.

Two faces, five requests

font-stretch: 75%

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: 87.5%

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: 99%

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: 100%

Aa · Designed widths change line breaks and preserve the shapes of letters.

font-stretch: 125%

Aa · Designed widths change line breaks and preserve the shapes of letters.

With both local fonts available, 75%, 87.5% and 99% select the condensed face registered as 75%; 100% and 125% use regular 100%. Synthesis is disabled. A computed value of 99% does not become a report of the chosen face.
Two faces, five requests
<div class="font-stretch-guide-matching">
  <div>
    <p class="label">font-stretch: 75%</p>
    <p class="sample width-0">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: 87.5%</p>
    <p class="sample width-1">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: 99%</p>
    <p class="sample width-2">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: 100%</p>
    <p class="sample width-3">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">font-stretch: 125%</p>
    <p class="sample width-4">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
</div>
@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialMT");
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
}

@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialNarrow");
  font-style: normal;
  font-weight: 400;
  font-stretch: condensed;
}

.font-stretch-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: "StretchGuideFaces", sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.6;
    font-synthesis: none;
  }

  .width-0 {
    font-stretch: 75%;
  }

  .width-1 {
    font-stretch: 87.5%;
  }

  .width-2 {
    font-stretch: 99%;
  }

  .width-3 {
    font-stretch: 100%;
  }

  .width-4 {
    font-stretch: 125%;
  }
}

The @font-face descriptor describes the resource; the element property requests it. Declare each static file with its correct width. Registering a normal file as condensed does not redesign its letters. A missing width does not require the next family; a missing glyph may need fallback.

The aliases use local("ArialMT") and local("ArialNarrow"), without font downloads. If those names are missing or access is blocked, sans-serif is used and the controlled comparison is no longer guaranteed. The playground’s families also depend on the device; its condensed stack may choose another family, which is not the same as varying one font.

Variable fonts and the wdth axis

A variable font with a wdth axis can offer intermediate widths within its range. Not every variable font includes that axis. Outlines can adjust strokes and spacing as well as widths; they are not a horizontally squashed copy of regular.

Reference recipe · requires your font with a wdth axis

Reference recipe · requires your font with a wdth axis
<p class="font-stretch-guide-variable">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
@font-face {
  font-family: "ExampleWidth";
  src: url("/fonts/example-width.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-stretch: 75% 125%;
  font-display: swap;
}

.font-stretch-guide-variable {
  font-family: "ExampleWidth", sans-serif;
  font-size: 1.25rem;
  font-stretch: condensed;
  line-height: 1.6;
  overflow-wrap: anywhere;

  @supports (font-stretch: 87.5%) {
    font-stretch: 87.5%;
  }
}

This recipe does not run or download its example URL. Replace it with a real weight-400 font whose wdth axis spans 75 to 125, or adapt the descriptors to its capabilities. The descriptor advertises 75% 125%; the paragraph requests one value, 87.5%. Declaring a range does not turn a static file into a variable font.

Prefer font-stretch or font-width for the registered wdth axis. font-variation-settings containing "wdth" can impose a low-level value and override the property. The axis uses numbers such as 87.5, while the property uses percentages such as 87.5%. Check the file, range, descriptors and active rules.

The relationship with font-width

CSS Fonts renames the property to font-width and retains font-stretch as a compatibility alias. Both names describe the same intent; they do not multiply as two scales. The specification’s preferred name still has narrower browser support.

Keep font-stretch as a fallback

Compatible alias · font-stretch: condensed

Aa · Designed widths change line breaks and preserve the shapes of letters.

Progressive enhancement · font-width: 75%

Aa · Designed widths change line breaks and preserve the shapes of letters.

Both rows request 75%. The second adds font-width only if the browser accepts that declaration; otherwise font-stretch: condensed remains effective. The result alone does not prove which property name applied.
Keep font-stretch as a fallback
<div class="font-stretch-guide-names">
  <div>
    <p class="label">Compatible alias · font-stretch: condensed</p>
    <p class="sample legacy">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">Progressive enhancement · font-width: 75%</p>
    <p class="sample progressive">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
</div>
@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialMT");
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
}

@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialNarrow");
  font-style: normal;
  font-weight: 400;
  font-stretch: condensed;
}

.font-stretch-guide-names {
  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: "StretchGuideFaces", sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.6;
    font-synthesis: none;
  }

  .legacy {
    font-stretch: condensed;
  }

  .progressive {
    font-stretch: condensed;

    @supports (font-width: 75%) {
      font-width: 75%;
    }
  }
}

To use the new name, first declare a compatible font-stretch value and apply the equivalent font-width value as progressive enhancement. Check the property and @font-face descriptor separately. The lab keeps its name, routes, controls and font-stretch output; reading the guide does not automatically migrate your code.

Font width versus scaleX()

Typeface selection participates in text layout; transform acts after layout. A condensed face may fit more letters on each line. scaleX() compresses the block’s rendering, including strokes, but keeps its previous line breaks and layout space.

The same reading limit, three results

Reference · font-stretch: normal

Aa · Designed widths change line breaks and preserve the shapes of letters.

Designed face · font-stretch: condensed

Aa · Designed widths change line breaks and preserve the shapes of letters.

Visual scaling · transform: scaleX(0.75)

Aa · Designed widths change line breaks and preserve the shapes of letters.

All three paragraphs have a 20rem maximum. With the local faces available, condensed may change line breaks; the scaleX row keeps regular’s breaks and visually reduces the block to 75%. Geometric equality between the designed face and transformation is not expected.
The same reading limit, three results
<div class="font-stretch-guide-transform">
  <div>
    <p class="label">Reference · font-stretch: normal</p>
    <p class="sample original">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">Designed face · font-stretch: condensed</p>
    <p class="sample selected">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
  <div>
    <p class="label">Visual scaling · transform: scaleX(0.75)</p>
    <p class="sample scaled">Aa · Designed widths change line breaks and preserve the shapes of letters.</p>
  </div>
</div>
@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialMT");
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
}

@font-face {
  font-family: "StretchGuideFaces";
  src: local("ArialNarrow");
  font-style: normal;
  font-weight: 400;
  font-stretch: condensed;
}

.font-stretch-guide-transform {
  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: "StretchGuideFaces", sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    font-style: normal;
    line-height: 1.6;
    font-synthesis: none;
  }

  .sample {
    max-inline-size: 20rem;
    font-stretch: normal;
  }

  .selected {
    font-stretch: condensed;
  }

  .scaled {
    transform: scaleX(0.75);
    transform-origin: left center;
  }
}

The left transform origin is chosen to compare physical X-axis scaling; it does not represent writing direction. Do not use scaling to fake font-stretch support. For reading text, choose an appropriate font and let the container and wrapping adapt before compressing it to fit.

Review strokes, accents, spacing and text resized to 200%. A very narrow design can hinder reading even if more content fits. Preserve line spacing, contrast and reflow; changing width does not replace font-size, letter-spacing or responsive layout.

Common mistakes

75% and 100% look identical

Expected result
Select two distinct widths.
Cause
The family only offers one face, the width descriptor is missing or a wdth setting fixes the axis.
Solution
Inspect the rendered font and active rules. Load suitable faces or a variable font with wdth; CSS.supports does not prove that capability.

75% does not measure three quarters of the paragraph

Expected result
Understand what the percentage requests.
Cause
A font width category has been confused with geometric scaling of the block.
Solution
Compare metrics and wrapping with the same text. Use the percentage to select a design and layout properties to size the container.

font-width does not work in a browser

Expected result
Keep a compatible width request.
Cause
font-stretch has been replaced by a name with different support.
Solution
Keep the font-stretch fallback and add font-width with verified support. Also check fonts and descriptors.

Support and compatibility

MDN lists font-stretch as Baseline Widely Available and font-width as limited availability. Support for keywords, percentages, descriptor ranges and variable files needs separate review.

BCD records font-stretch percentages since Chrome 62, Firefox 61 and Safari 11.1. For font-width it records Firefox 155 and Safari 18.4, with Chrome listed as unsupported. This is a dated check, not a future guarantee or proof of installed fonts.

The four comparisons apply native HTML/CSS and retain content without JavaScript. The variable recipe is identified as a reference. getComputedStyle reports the computed value; use browser font tools and visual review to identify the rendered resource and check its differences.