CSS text-transform Property

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

What You’ll Learn

The text-transform property controls how text is capitalized — uppercase, lowercase, capitalize each word, or leave it unchanged.

01

none

Default text.

02

capitalize

Title case.

03

uppercase

ALL CAPS.

04

lowercase

all small.

05

UI Labels

Buttons & nav.

06

Consistency

Normalize text.

Introduction

The text-transform property in CSS allows you to control the capitalization of text. It can transform text to uppercase, lowercase, or capitalize each word, making it a versatile tool for text formatting in web design.

This property is useful for ensuring consistency in the appearance of text, regardless of how it is entered by users or stored in a database.

Definition and Usage

Use text-transform when you want visual capitalization without changing the HTML source — for example, making all button labels uppercase or title-casing navigation items from messy user input.

💡
Beginner Tip

text-transform changes how text looks, not what is stored. Screen readers and copy-paste may still use the original casing from your HTML.

📝 Syntax

The syntax for the text-transform property is simple. It can be applied to any text element.

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

Basic Example

text-transform.css
.uppercase {
  text-transform: uppercase;
}

Syntax Rules

  • Accepts keyword values: none, capitalize, uppercase, lowercase.
  • capitalize uppercases the first letter of each word, not every letter.
  • full-width exists for East Asian typography but has limited browser support.
  • The property is inherited; child elements follow the parent unless overridden.

Related Properties

  • font-variant — controls small-caps and other typographic variants
  • letter-spacing — often paired with uppercase labels for readability
  • text-decoration — adds underlines or lines through text

🎯 Default Value

The default value of the text-transform property is none, which means the text is displayed as it is entered or stored.

⚡ Quick Reference

QuestionAnswer
Default valuenone
All capstext-transform: uppercase;
All lowercasetext-transform: lowercase;
Title case per wordtext-transform: capitalize;
Reset transformationtext-transform: none;
InheritedYes

💎 Property Values

The text-transform property accepts keyword values that control capitalization style.

ValueExampleDescription
nonetext-transform: none;No transformation is applied. The text is displayed normally.
capitalizetext-transform: capitalize;Transforms the first character of each word to uppercase.
uppercasetext-transform: uppercase;Transforms all characters to uppercase.
lowercasetext-transform: lowercase;Transforms all characters to lowercase.
full-widthtext-transform: full-width;Transforms characters to their full-width form, typically used in East Asian typography (not supported in all browsers).
none capitalize uppercase lowercase

When to Use text-transform

text-transform helps keep typography consistent across your site:

  • Button labels — Apply uppercase for compact, bold CTAs.
  • Navigation menus — Use capitalize for readable menu items.
  • User content — Normalize inconsistent casing from forms or databases.
  • Metadata tags — Style category labels with lowercase for a subtle look.

👀 Live Preview

The same sentence with each text-transform value applied:

none hello world from css
capitalize hello world from css
uppercase hello world from css
lowercase HELLO WORLD FROM CSS

Examples Gallery

In this example, we’ll apply different text transformations to paragraphs.

📜 Basic Values

Compare none, capitalize, uppercase, and lowercase on the same page.

Example 1 — All text-transform values

In this example, we’ll apply different text transformations to paragraphs.

index.html
<style>
  .none { text-transform: none; }
  .capitalize { text-transform: capitalize; }
  .uppercase { text-transform: uppercase; }
  .lowercase { text-transform: lowercase; }
</style>

<p class="none">This text is not transformed.</p>
<p class="capitalize">this text is capitalized.</p>
<p class="uppercase">this text is uppercase.</p>
<p class="lowercase">THIS TEXT IS LOWERCASE.</p>
Try It Yourself

How It Works

Each class applies a different keyword. The browser renders the visual casing without changing the HTML source text.

Example 2 — Uppercase button label

Design systems often use uppercase on small buttons for a strong, compact label style.

button.css
.btn {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  font-weight: 600;
}
Try It Yourself

How It Works

Even though the HTML says “sign up free”, CSS displays it as “SIGN UP FREE” with extra letter-spacing for readability.

📄 UI Patterns

Apply capitalization styles to navigation and metadata labels.

Example 3 — Capitalize navigation links

Use capitalize to title-case menu items written in lowercase in your markup.

nav.css
.nav-link {
  text-transform: capitalize;
  color: #334155;
  text-decoration: none;
}
Try It Yourself

How It Works

Each link’s first letter per word becomes uppercase, giving a polished menu without editing the HTML text.

Example 4 — Lowercase category tags

Style badge or tag text with lowercase for a modern, understated metadata look.

tag.css
.tag {
  text-transform: lowercase;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #e2e8f0;
}
Try It Yourself

How It Works

Tags stored in ALL CAPS render as lowercase badges, keeping markup flexible while controlling presentation.

♿ Accessibility

  • Screen readers — May announce text using the original HTML casing, not the transformed visual form.
  • Avoid ALL CAPS for long text — Uppercase blocks of text are harder to read for many users.
  • Do not rely on casing alone — Use semantic HTML and labels; transformation is decorative.
  • Prefer proper source text — For important content, write correct casing in HTML when possible.

capitalize vs uppercase

capitalize only uppercases the first letter of each word. uppercase converts every character. Choose based on whether you need title case or full caps.

compare.css
/* "hello world" → "Hello World" */
.title { text-transform: capitalize; }

/* "hello world" → "HELLO WORLD" */
.label { text-transform: uppercase; }

🧠 How text-transform Works

1

Text is rendered

The browser reads text from HTML, CSS content, or user input.

Source
2

Transform rule applies

CSS applies uppercase, lowercase, or capitalize before painting.

Transform
3

Visual casing changes

Users see the transformed casing on screen while the DOM text stays the same.

Display
=

Consistent typography

Mixed or messy source text displays with uniform capitalization.

Browser Compatibility

The text-transform property is widely supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It works reliably across different platforms and devices, making it a dependable tool for text formatting.

Universal · All modern browsers

Reliable text formatting

Chrome, Firefox, Safari, Edge, and Opera all support none, capitalize, uppercase, and lowercase.

99% Browser support
Google Chrome 1+ · Desktop & Mobile
Full support
Mozilla Firefox 1+ · Desktop & Mobile
Full support
Apple Safari 1+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 3.5+ · All versions
Full support

Testing tip

The full-width value has limited support. Stick to the four main keywords for production UI.

text-transform property 99% supported

Bottom line: text-transform is safe to use for capitalization styling in all modern web projects.

Conclusion

The text-transform property is a useful feature in CSS for controlling the capitalization and formatting of text on your web pages.

Whether you need to standardize the appearance of user-generated content or enhance the readability of your text, text-transform offers a straightforward solution. Experiment with different values to see how they can improve the look and feel of your text.

💡 Best Practices

✅ Do

  • Use uppercase sparingly on short labels and buttons
  • Pair uppercase text with slightly increased letter-spacing
  • Use capitalize for title-style navigation items
  • Reset inherited transforms with text-transform: none; when needed
  • Write meaningful text in HTML for accessibility when possible

❌ Don’t

  • Uppercase entire paragraphs or articles
  • Assume screen readers will read transformed casing
  • Use capitalize when you need every letter capitalized
  • Depend on full-width for cross-browser layouts

Key Takeaways

Knowledge Unlocked

Five things to remember about text-transform

Use these points when controlling text capitalization in CSS.

5
Core concepts
02

none

Default value.

Default
🔠 03

uppercase

ALL CAPS.

Keyword
📝 04

capitalize

Title case.

Keyword
🔗 05

Inherited

Flows to children.

Cascade

❓ Frequently Asked Questions

text-transform controls the capitalization of text. You can display text as uppercase, lowercase, capitalize each word, or leave it unchanged with none.
The default is none, which means text is displayed exactly as written in the HTML or source content.
No. capitalize only uppercases the first character of each word. Use uppercase to make every letter capital.
Yes, text-transform is inherited. Setting it on a parent affects child text unless a child overrides it.
No. It is a visual presentation change only. The underlying HTML and copy-pasted text remain unchanged.

Practice in the Live Editor

Open the HTML editor and try uppercase, lowercase, and capitalize on the same paragraph.

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