CSS text-justify Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography

What You’ll Learn

The text-justify property controls how justified text spreads extra space — between words or between characters.

01

Justify Mode

Spacing method.

02

auto

Browser default.

03

inter-word

Word spacing.

04

inter-character

Character gaps.

05

text-align

Pair with justify.

06

CJK Text

East Asian use.

Introduction

The text-justify property in CSS is used to specify the justification method for text when the text-align property is set to justify.

This property determines how the browser should distribute space between words and characters to align text evenly along both the left and right margins.

Definition and Usage

Use text-justify when you already have text-align: justify; and want finer control over how the browser fills each line. It is especially helpful for multilingual layouts and typography-heavy pages.

💡
Beginner Tip

Always set text-align: justify; first. Then add text-justify: inter-word; for typical English paragraphs.

📝 Syntax

The syntax for the text-justify property is straightforward. It is applied to block-level elements containing text:

syntax.css
element {
  text-justify: value;
}

Here, value can be one of the predefined keywords specifying the justification method.

Basic Example

text-justify.css
p {
  text-align: justify;
  text-justify: inter-word;
}

Syntax Rules

  • text-justify only matters when text-align is set to justify.
  • Use inter-word for most Western language paragraphs.
  • Use inter-character for East Asian languages or dense character layouts.
  • The property is inherited, so parent values can affect child blocks.

Related Properties

  • text-align — sets left, center, right, or justify alignment
  • word-spacing — manually adjusts space between words
  • letter-spacing — manually adjusts space between characters

🎯 Default Value

The default value of the text-justify property is auto, which means the browser uses its default justification algorithm.

⚡ Quick Reference

QuestionAnswer
Default valueauto
Required pairtext-align: justify;
Word spacing methodtext-justify: inter-word;
Character spacing methodtext-justify: inter-character;
Common useArticles, newspapers, and multilingual layouts
InheritedYes

💎 Property Values

The text-justify property accepts keyword values that control spacing strategy.

ValueExampleDescription
autotext-justify: auto;Uses the default justification method provided by the browser.
inter-wordtext-justify: inter-word;Justifies text by adding space between words.
inter-charactertext-justify: inter-character;Justifies text by adding space between characters. This value is commonly used for East Asian languages.
auto inter-word inter-character

When to Use text-justify

text-justify helps when justified text needs better spacing control:

  • News and articles — Use inter-word for clean paragraph justification.
  • East Asian content — Use inter-character when word boundaries are less useful.
  • Multilingual sites — Match justification method to each language section.
  • Print-like layouts — Fine-tune how lines stretch to both margins.

👀 Live Preview

All samples use text-align: justify; with different text-justify methods:

auto

This paragraph uses the browser default justification method. Extra space is distributed according to the browser algorithm when lines are stretched to both edges.

inter-word

This paragraph uses inter-word justification. Extra space is added between words so each line reaches both the left and right margins evenly.

inter-character

This paragraph uses inter-character justification. Extra space is added between characters, which is useful for East Asian typography and dense text blocks.

Examples Gallery

In this example, we’ll demonstrate the different values of the text-justify property.

📜 Justification Methods

Compare auto, inter-word, and inter-character spacing on justified text.

Example 1 — All text-justify values

In this example, we’ll demonstrate the different values of the text-justify property.

index.html
<style>
  .auto {
    text-align: justify;
    text-justify: auto;
  }
  .inter-word {
    text-align: justify;
    text-justify: inter-word;
  }
  .inter-character {
    text-align: justify;
    text-justify: inter-character;
  }
</style>

<h1>Text Justification Examples</h1>
<h2>Auto</h2>
<p class="auto">...</p>
<h2>Inter-Word</h2>
<p class="inter-word">...</p>
<h2>Inter-Character</h2>
<p class="inter-character">...</p>
Try It Yourself

How It Works

Each class pairs text-align: justify with a different spacing strategy for the same block width.

Example 2 — inter-word for article paragraphs

Use inter-word for standard English body copy where word spacing should absorb the extra line width.

inter-word.css
.article-body p {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.7;
}
Try It Yourself

How It Works

The browser adds extra space between words on each line until both edges align.

🌍 Language-Specific Layouts

Choose character spacing for CJK text and browser defaults for general content.

Example 3 — inter-character for East Asian text

Use inter-character when character-level spacing produces better justified lines.

inter-character.css
.jp-block {
  text-align: justify;
  text-justify: inter-character;
}
Try It Yourself

How It Works

Character gaps expand instead of word gaps, which suits languages without clear word spacing.

Example 4 — auto for browser-default justification

Let the browser choose the best justification strategy with the default auto value.

auto-justify.css
.news-column p {
  text-align: justify;
  text-justify: auto;
}
Try It Yourself

How It Works

auto delegates spacing decisions to the browser based on language and rendering rules.

♿ Accessibility

  • Use justification carefully — Fully justified text can create uneven word gaps that are harder to read.
  • Prefer left alignment for body copy — Many accessibility guides recommend against justified paragraphs for long reading.
  • Watch line length — Justified text in very wide or very narrow columns can look uneven.
  • Test with real content — Short demo paragraphs may not reveal spacing problems visible in long articles.

text-justify with text-align

text-justify never replaces text-align. Set alignment to justify first, then choose how space should be distributed.

justify-pair.css
.legal-copy {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

🧠 How text-justify Works

1

Text is set to justify

text-align: justify; tells the browser to stretch lines to both margins.

Alignment
2

You choose a spacing method

Pick auto, inter-word, or inter-character.

Method
3

Browser distributes extra space

Each line expands using word gaps or character gaps until both edges align.

Rendering
=

Even edge alignment

Justified blocks look structured with controlled spacing behavior.

Browser Compatibility

The text-justify property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Modern browsers · Wide support

Justification control in today’s browsers

Chrome, Firefox, Safari, Edge, and Opera all support text-justify in current versions.

94% Modern browser support
Google Chrome 32+ · Desktop & Mobile
Full support
Mozilla Firefox 20+ · Desktop & Mobile
Full support
Apple Safari 7+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 19+ · Modern versions
Full support

Testing tip

Compare inter-word and inter-character results in Safari and Firefox with mixed-language content.

text-justify property 94% supported

Bottom line: text-justify is safe to use for justified typography in modern multilingual projects.

Conclusion

The text-justify property is a useful tool for web developers looking to control how text is justified within their web pages.

By specifying different justification methods, you can achieve precise control over text alignment, especially in multi-language and typographically complex documents. Experiment with the various values to see how they affect the layout and readability of your text.

💡 Best Practices

✅ Do

  • Set text-align: justify; before using text-justify
  • Use inter-word for most English paragraphs
  • Use inter-character for East Asian language blocks
  • Test justified text at different viewport widths
  • Combine with hyphens: auto; when appropriate

❌ Don’t

  • Expect text-justify to work without justified alignment
  • Justify very short paragraphs or single-line headings
  • Ignore uneven word gaps in narrow columns
  • Use justified text everywhere without checking readability

Key Takeaways

Knowledge Unlocked

Five things to remember about text-justify

Use these points when styling justified text.

5
Core concepts
02

auto

Browser default.

Default
💬 03

inter-word

Word spacing.

Common
🌍 04

inter-character

CJK layouts.

Language
05

text-align

Needs justify.

Pair

❓ Frequently Asked Questions

text-justify controls how space is distributed when text is justified. It works together with text-align: justify to choose word spacing or character spacing.
The default is auto, which lets the browser choose its default justification algorithm.
Yes. text-justify only affects text when text-align is set to justify.
Use inter-character for East Asian languages or when adjusting space between characters produces better justified lines.
Yes, text-justify is inherited, so setting it on a parent can affect nested text blocks.

Practice in the Live Editor

Open the HTML editor and try text-align: justify; with text-justify: inter-word;.

HTML Editor →

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.

5 people found this page helpful