CSS Portal

CSS word-spacing Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The word-spacing property controls the amount of horizontal space the browser inserts between words — specifically the gaps that exist where text contains one or more whitespace characters. It is a typographic tool for adjusting the rhythm and density of a block of text: small increases can improve readability in tightly set type, while reductions can help squeeze more text into a constrained layout without changing font size. Note that word-spacing operates on inter-word gaps; it does not alter the spacing between individual glyphs inside a word (that is handled by letter-spacing).

Because browsers collapse and render whitespace according to layout rules, the visual effect of word-spacing depends on surrounding formatting decisions. The property's effect is applied to the spaces the renderer treats as word separators, so its visible result is influenced by how whitespace is handled in the document flow — for example, behavior governed by white-space — and by line-breaking and hyphenation strategies (see hyphens). When text is justified, word gaps may be stretched or compressed by the justification algorithm in addition to any explicit adjustments, so the interplay between word spacing and alignment can produce subtle or dramatic changes in text color and rag.

In practical use, designers apply word-spacing for typographic refinement: to improve horizontal balance in headlines, to adjust density for long-form reading, or to harmonize spacing across different fonts and languages. Large adjustments can affect legibility and the sense of rhythm, so they are often paired with other text properties to maintain overall harmony — for example, alignment settings like text-align and vertical metrics such as line-height. Use it judiciously, especially in multilingual contexts where script-specific spacing conventions and font metrics can cause the same adjustment to look very different.

Definition

Initial value
normal
Applies to
All elements
Inherited
Yes
Computed value
An absolute length
Animatable
No
JavaScript syntax
object.style.wordSpacing

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

Syntax

word-spacing: [ normal | <length> | <percentage>] 

Values

  • normalNo additional spacing is applied.
  • <length>Specifies extra spacing in addition to the intrinsic inter-word spacing defined by the font. Values may be negative, but there may be implementation-dependent limits.
  • <percentage>Specifies the additional spacing as a percentage of the affected character's advance measure.
  • inherit

Example

<div class="example">
<h1>CSS word-spacing demo</h1>
<p class="normal">This paragraph uses the default word spacing. The spacing between words is determined by the browser's default font metrics.</p>
<p class="wide">This paragraph increases word spacing using <code>word-spacing: 0.8em;</code> It creates more space between words for improved readability.</p>
<p class="tight">This paragraph decreases word spacing using <code>word-spacing: -0.15em;</code> Words appear slightly closer together.</p>
</div>
.example {
  font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;
  max-width: 700px;
  margin: 2rem auto;
  line-height: 1.6;
  color: #222;
}

.example h1 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.example p {
  margin-bottom: 1rem;
}

.normal {
  word-spacing: normal;
}

.wide {
  word-spacing: 0.8em;
}

.tight {
  word-spacing: -0.15em;
}

Browser Support

The following information will show you the current browser support for the CSS word-spacing property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!