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.
Fundamentals
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.
Foundation
📝 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
Defaults
🎯 Default Value
The default value of the text-justify property is auto, which means the browser uses its default justification algorithm.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
auto
Required pair
text-align: justify;
Word spacing method
text-justify: inter-word;
Character spacing method
text-justify: inter-character;
Common use
Articles, newspapers, and multilingual layouts
Inherited
Yes
Reference
💎 Property Values
The text-justify property accepts keyword values that control spacing strategy.
Value
Example
Description
auto
text-justify: auto;
Uses the default justification method provided by the browser.
inter-word
text-justify: inter-word;
Justifies text by adding space between words.
inter-character
text-justify: inter-character;
Justifies text by adding space between characters. This value is commonly used for East Asian languages.
autointer-wordinter-character
Context
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.
Preview
👀 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.
Hands-On
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.
Article paragraphs often look cleaner with inter-word justification because the browser expands space between words instead of stretching individual letters apart.
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.
With auto, the browser applies its default justification algorithm for the current language and font, which is a safe starting point for general content.
How It Works
auto delegates spacing decisions to the browser based on language and rendering rules.
A11y
♿ 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.
Companion
text-justify with text-align
text-justify never replaces text-align. Set alignment to justify first, then choose how space should be distributed.
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.
Compatibility
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 Chrome32+ · Desktop & Mobile
Full support
Mozilla Firefox20+ · Desktop & Mobile
Full support
Apple Safari7+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera19+ · Modern versions
Full support
Testing tip
Compare inter-word and inter-character results in Safari and Firefox with mixed-language content.
text-justify property94% supported
Bottom line:text-justify is safe to use for justified typography in modern multilingual projects.
Wrap Up
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.
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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about text-justify
Use these points when styling justified text.
5
Core concepts
📄01
Spacing Method
Controls justify gaps.
Purpose
⚙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.