Support0

CSS word-spacing playground

Explore word-spacing with controls for spreading out or tightening words on a real text block and checking how readability changes.

Ask AI

CSS word-spacing playground

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

BaselineLab lets you compare word-spacing with real text, normal spacing, positive and negative lengths, and percentages defined by CSS Text Level 4. Adjust the space between words while preserving rhythm, line length and readability.

HTML
<p class="word-spacing-sample">
  BaselineLab lets you compare word-spacing with real text,
  normal spacing, positive and negative lengths, and percentages defined by CSS Text Level 4.
  Adjust the space between words while preserving rhythm, line length and readability.
</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-2xl text-2xl font-bold leading-normal [word-spacing:0.35rem]">
  BaselineLab lets you compare word-spacing with real text,
  normal spacing, positive and negative lengths, and percentages defined by CSS Text Level 4.
  Adjust the space between words while preserving rhythm, line length and readability.
</p>
CSS
.word-spacing-sample {
  max-inline-size: 38rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.45;
  word-spacing: 0.35rem;
}

Educational guide to word-spacing

Give words room to breathe

Adjust the distance between words without altering their letters. Compare units, inheritance, and tracking, and see what happens in text without word separators.

Mental model

word-spacing adds or removes space at word separators left after white space processing. The font’s own spacing remains part of the result: setting 0 does not join words together.

  1. Existing separator

    An ordinary space, such as the one between two Latin words, has its own width. Without separators, no new gaps are invented between words.

  2. Added adjustment

    normal adds no space; a positive length increases it and a negative one reduces it. The result also depends on the font.

  3. Recomposed line

    The new gaps can change line breaks. Use gap or margins to separate interface elements, rather than spaces inside text.

Static diagram of word spacingThe visual layout changes, while the text content stays intact. You do not need to insert extra spaces or wrap each word in an element.

Word spacing versus tracking

Use word-spacing to adjust separators and letter-spacing for tracking between typographic units. The same length does not have the same effect: it acts at different places in the text.

One phrase with five settings

word-spacing: normal

Read with space

word-spacing: 0

Read with space

word-spacing: -0.05em

Read with space

word-spacing: 0.2em

Read with space

Comparison · letter-spacing: 0.2em

Read with space

normal and 0 preserve the font’s spacing. −0.05em reduces it and 0.2em increases it without spreading letters inside each word. The last row applies letter-spacing: 0.2em for comparison.
One phrase with five settings
<div class="word-spacing-guide-values">
  <div>
    <p class="label">word-spacing: normal</p>
    <p class="sample spacing-0">Read with space</p>
  </div>
  <div>
    <p class="label">word-spacing: 0</p>
    <p class="sample spacing-1">Read with space</p>
  </div>
  <div>
    <p class="label">word-spacing: -0.05em</p>
    <p class="sample spacing-2">Read with space</p>
  </div>
  <div>
    <p class="label">word-spacing: 0.2em</p>
    <p class="sample spacing-3">Read with space</p>
  </div>
  <div>
    <p class="label">Comparison · letter-spacing: 0.2em</p>
    <p class="sample tracking">Read with space</p>
  </div>
</div>
.word-spacing-guide-values {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    word-spacing: normal;
  }

  .sample {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.6;
    letter-spacing: normal;
  }

  .spacing-0 {
    word-spacing: normal;
  }

  .spacing-1 {
    word-spacing: 0;
  }

  .spacing-2 {
    word-spacing: -0.05em;
  }

  .spacing-3 {
    word-spacing: 0.2em;
  }

  .tracking {
    word-spacing: normal;
    letter-spacing: 0.2em;
  }
}

These values are tests, not a legibility scale. Excessive negative spacing can visually merge words, while excessive positive spacing disrupts reading rhythm. With white-space: normal, repeated ordinary spaces collapse before the adjustment applies.

Units and inheritance

em uses the font-size of the element declaring the length, rem uses the root size, and px sets a fixed CSS length. word-spacing inherits: a descendant receives an already computed em length, rather than a factor multiplied again by its own size.

Inherit a length or calculate it again

0.2em on the parent; the descendant inherits

Read with space
Read with space

0.2em on the parent and declared again on the descendant

Read with space
Read with space

With a 16 px root, the 1.25rem parent adds 4 px to each separator. The 1.75rem text inherits that 4 px; declaring its own 0.2em adds 5.6 px. These are added amounts, not the space’s total width.
Inherit a length or calculate it again
<div class="word-spacing-guide-units">
  <div>
    <p class="label">0.2em on the parent; the descendant inherits</p>
    <p class="sample">Read with space<br><span class="larger">Read with space</span></p>
  </div>
  <div>
    <p class="label">0.2em on the parent and declared again on the descendant</p>
    <p class="sample">Read with space<br><span class="larger own-spacing">Read with space</span></p>
  </div>
</div>
.word-spacing-guide-units {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    word-spacing: normal;
  }

  .sample {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.6;
    letter-spacing: normal;
  }

  .sample {
    word-spacing: 0.2em;
  }

  .larger {
    font-size: 1.75rem;
  }

  .own-spacing {
    word-spacing: 0.2em;
  }
}

Declare em at each size that should keep the local proportion. Use rem when the adjustment should follow the root, and check the font actually used. The separator’s natural spacing can change even when the added amount stays the same.

Separators and writing systems

The property does not segment a language to insert spaces. Japanese or Thai text may lack separators even when the browser recognizes line break opportunities. In Arabic, adjusting space between words differs from separating connected letters.

With and without separators

Arabic · normal

مرحبا بالعالم

Arabic · word-spacing: 0.2em

مرحبا بالعالم

Japanese · normal

読みやすい文字

Japanese · word-spacing: 0.2em

読みやすい文字

Both Arabic samples keep lang="ar" and dir="rtl": the gap between words changes. The Japanese samples keep the same text without spaces and usually look alike. Letter-spacing is not used to change letter joins.
With and without separators
<div class="word-spacing-guide-scripts">
  <div>
    <p class="label">Arabic · normal</p>
    <p class="sample" lang="ar" dir="rtl">مرحبا بالعالم</p>
  </div>
  <div>
    <p class="label">Arabic · word-spacing: 0.2em</p>
    <p class="sample spaced" lang="ar" dir="rtl">مرحبا بالعالم</p>
  </div>
  <div>
    <p class="label">Japanese · normal</p>
    <p class="sample" lang="ja">読みやすい文字</p>
  </div>
  <div>
    <p class="label">Japanese · word-spacing: 0.2em</p>
    <p class="sample spaced" lang="ja">読みやすい文字</p>
  </div>
</div>
.word-spacing-guide-scripts {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    word-spacing: normal;
  }

  .sample {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.6;
    letter-spacing: normal;
  }

  .sample {
    word-spacing: normal;
  }

  .spaced {
    word-spacing: 0.2em;
  }
}

Not every white space character is a word separator. A no-break space (U+00A0) accepts the adjustment while retaining its line break restriction; a zero-width space does not gain a new gap through word-spacing. Review each language’s conventions and fonts.

Common pitfalls

Words look like a single word

Expected result
Word boundaries remain clear.
Cause
A negative value removes too much of the separator’s natural width.
Solution
Return to normal, compare a small adjustment, and allow wrapping. Do not compress text simply to force it onto one line.

The value changes but the text does not

Expected result
The adjustment is visible where word separators exist.
Cause
The text may have no separators, or may use characters that do not receive this adjustment.
Solution
Inspect the actual text and compare a phrase with ordinary spaces. Do not insert artificial spaces to force one writing system to behave like another.

User spacing clips the content

Expected result
The block grows and preserves its content and actions.
Cause
A fixed height, nowrap, or overflow clipping prevents reflow.
Solution
Test the combined WCAG 1.4.12 settings, including 0.16em word-spacing, without losing content or functionality. This checks adaptability; it does not require those values as the initial style.

Support and compatibility

normal and lengths are Baseline Widely Available. Percentages have a different history: BCD lists Chrome 145, Firefox 45, and Safari 17.4 as the first versions. Current CSS Text Level 4 and MDN define them relative to the text’s font-size, not the container width or the font’s natural space.

An em base before the percentage

Base · word-spacing: 0.2em

Read with space

Progressive enhancement · 20% if accepted

Read with space

At the same font size, 20% and 0.2em request the same added amount under the current model. The second row keeps 0.2em if the browser rejects percentages. Both can look alike with or without support.
An em base before the percentage
<div class="word-spacing-guide-percentage">
  <div>
    <p class="label">Base · word-spacing: 0.2em</p>
    <p class="sample">Read with space</p>
  </div>
  <div>
    <p class="label">Progressive enhancement · 20% if accepted</p>
    <p class="sample progressive">Read with space</p>
  </div>
</div>
.word-spacing-guide-percentage {
  display: grid;
  gap: 1rem;
  overflow-wrap: anywhere;

  .label {
    margin-block: 0 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    word-spacing: normal;
  }

  .sample {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.6;
    letter-spacing: normal;
  }

  .sample {
    word-spacing: 0.2em;
  }

  .progressive {
    @supports (word-spacing: 20%) {
      word-spacing: 20%;
    }
  }
}

The playground already offers percentages. @supports checks syntactic acceptance; it does not prove the reference used by every older version or certify layout in every language. To keep results stable across those versions, retain the em length and test your target browsers.