CSS text-justify Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The text-justify property sets how justification works when text-align: justify is set. It chooses whether extra space goes mainly between words or between characters.

It is inherited. The initial value is auto. Without text-align: justify, this property has no visible effect.

Limited availability Not Baseline

Supported in Firefox and recent Chromium. Safari does not support it. Treat it as progressive enhancement, not a hard layout requirement.

Deprecated Prefer inter-character over distribute

distribute matches inter-character and exists only for older content. Use inter-character in new CSS.

CSS Syntax

syntax.css
text-justify: auto | none | inter-word | inter-character | initial | inherit;

Always pair it with text-align: justify. Language-tag your content for better auto results.

Property Values

ValueDescriptionTry it
autoDefault. Browser chooses a method for the languageTry it
inter-wordAdjust space between words (like varying word-spacing)Try it
inter-characterAdjust space between characters (like letter-spacing)Try it
noneTurns justification opportunities offTry it
initialResets to autoTry it
inheritTakes the parent’s valueTry it

How to Use text-justify

Justify the text first, then choose the spacing method.

  1. Set text-align: justify on the block.
  2. Choose inter-word for space-separated languages, or inter-character for character-based scripts.
  3. Leave auto when you want the browser to decide.
  4. Tag the language with lang so auto can pick better rules.
PieceRequired?Role
text-align: justifyYesTurns justification on
text-justify keywordYes (to choose method)How extra space is distributed
Language tagRecommendedHelps auto pick a suitable algorithm
Fallback planRecommendedSafari and older Chromium may ignore the method

Live Preview

The sample is already justified. Change the method and compare spacing. In unsupported browsers, values may look the same.

Requires text-align: justify (already set). Differences are clearest in Firefox and recent Chromium.

Justification preview

An example of justified English text used to compare spacing methods for the text-justify property.

text-justify: auto

CSS Examples

Each snippet focuses on text-justify and includes text-align: justify so the method can apply. Use Try It Yourself for a live editor.

Example 1 — Space Between Words

Best default for English and other space-separated languages.

CSS
<style>
  p {
    text-align: justify;
    text-justify: inter-word;
  }
</style>

<p>An example of justified English text used to compare spacing methods for the text-justify property.</p>
Try It Yourself

How It Works

  1. Justify the block. text-align: justify stretches each full line.
  2. Choose inter-word. Spacing opportunities are word separators.
  3. Like word-spacing. Gaps between words grow or shrink to fill the line.
  4. Check the browser. Unsupported engines may keep their default justify look.

Example 2 — Space Between Characters

Useful for Japanese and other scripts that justify by character spacing.

CSS
<style>
  p {
    text-align: justify;
    text-justify: inter-character;
  }
</style>

<p lang="ja">これは文字間のスペースを調整して行を揃える例です。</p>
Try It Yourself

How It Works

  1. Keep justify on. Same requirement as the first example.
  2. Choose inter-character. Gaps open between adjacent character units.
  3. Like letter-spacing. That is the effective spacing model.
  4. Tag the language. lang="ja" helps related typography features.

Example 3 — Turn Justification Off

Disable justification opportunities while leaving text-align: justify in the cascade.

CSS
<style>
  p {
    text-align: justify;
    text-justify: none;
  }
</style>

<p>Justification opportunities are turned off for this paragraph.</p>
Try It Yourself

How It Works

  1. Keep the align value. You do not have to remove justify from the cascade.
  2. Set none. No justification opportunities are used.
  3. Effectively left-aligned lines. Full lines no longer stretch with extra gaps.
  4. Toggle friendly. Handy when a parent sets justify and a child must opt out.

Edge Cases & Pitfalls

If nothing changes, one of these is usually why.

align

Needs text-align: justify

Without justified alignment, text-justify does not create stretched lines.

support

Safari ignores it today

Layout must still look fine with the browser’s default justify behavior alone.

lang

Language tags help auto

Mark content with lang. Justification quality is language-sensitive.

legacy

Skip distribute in new CSS

It is a deprecated alias of inter-character. Prefer the modern keyword.

last

Last line is separate

Control the final line with text-align-last. text-justify does not replace that.

Browser Support

text-justify is a browser layout property. Node.js, Deno, and Bun do not apply it.

✓ Limited availability · Not Baseline

text-justify

Firefox has long supported it. Chromium enabled it around version 145. Safari still lacks support.

71% Global support (approx.)
Google Chrome 145+
Full
Mozilla Firefox 55+
Full
Apple Safari No
None
Microsoft Edge 145+
Full
Opera 131+
Full
Samsung Internet Limited
Partial
Internet Explorer Partial
Partial
text-justify Limited

Bottom line: Use as progressive enhancement. Justified text with text-align: justify still works everywhere; the method keyword may not.

Key Takeaways

  • Role: choose the justification method when text is justified.
  • Common values: auto, inter-word, inter-character, none.
  • Requires: text-align: justify. Initial value is auto. Inherited.
  • Support: limited. Not Baseline. Avoid depending on it for critical layout.

One line: text-justify decides whether justified lines stretch between words or between characters.

Frequently Asked Questions

It chooses how space is distributed when text is justified. It only applies when text-align is set to justify.
The initial value is auto. The browser picks a method based on language and quality versus performance.
Yes. Without text-align: justify, changing text-justify has no visible effect.
inter-word adds space between words and suits languages that use spaces, such as English. inter-character adds space between characters and suits languages such as Japanese.
distribute is a deprecated alias of inter-character, kept for older content. Prefer inter-character in new CSS.
Support is limited: Firefox 55+, Chrome/Edge 145+, and Opera around 131+. Safari does not support it. It is a browser layout property, not a Node.js feature.

Next: text-orientation

Learn how characters orient in vertical writing modes.

text-orientation tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful