CSS text-transform Property

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

Definition and Usage

The text-transform property controls how text is capitalized for display. Common values are uppercase, lowercase, capitalize, and none.

It is a presentation change only—the HTML source stays as written. Use it for headings, buttons, and labels when you want consistent casing without editing every string.

Standard-track.

Baseline widely available for the common keywords. Not deprecated as a property.

Limited support.

full-width and full-size-kana mainly work in Firefox and Safari. math-auto is for math italic (mainly MathML) and is not in Safari yet.

Accessibility casing

Some assistive tech still announces the original source casing. Prefer real sentence case in content when meaning depends on it.

CSS Syntax

syntax.css
text-transform: none | capitalize | uppercase | lowercase | initial | inherit;

Also defined: full-width, full-size-kana, and math-auto—use only when you need those specialized scripts or math behaviors.

Property Values

ValueDescriptionTry it
noneNo casing change (initial)Try it
uppercaseAll letters uppercaseTry it
lowercaseAll letters lowercaseTry it
capitalizeFirst letter of each word uppercaseTry it
initialResets to noneTry it
inheritTakes the parent’s text-transformTry it

How to Use text-transform

Write natural casing in HTML, then transform for style when needed.

  1. Keep readable sentence or title case in the markup.
  2. Pick uppercase, lowercase, capitalize, or none.
  3. Apply on the element that should change (or a parent, since it inherits).
  4. Pair with letter-spacing when all-caps headings need breathing room.
GoalTypical value
Button / label shoutuppercase
Title-style wordscapitalize
Force small letterslowercase
Keep source casingnone

Live Preview

Same source sentence. Change only text-transform.

Source text stays css text transform sample. Only the display casing changes.

Text

css text transform sample

text-transform: uppercase

CSS Examples

Each snippet focuses on text-transform. Use Try It Yourself for a live editor.

Example 1 — All Uppercase

Display every letter in capitals.

CSS
<style>
  p {
    text-transform: uppercase;
  }
</style>

<p>css text transform sample</p>
Try It Yourself

How It Works

  1. Write any casing. The HTML can stay lowercase for easy editing.
  2. Apply uppercase. The browser maps each letter to its uppercase form for display.
  3. Source unchanged. Selecting or inspecting the node still shows the original string.
  4. Common use. Short labels and UI chrome where ALL CAPS is intentional.

Example 2 — Capitalize Each Word

Uppercase only the first letter of each word.

CSS
<style>
  p {
    text-transform: capitalize;
  }
</style>

<p>css text transform sample</p>
Try It Yourself

How It Works

  1. Word starts matter. The first letter after a word break becomes uppercase.
  2. Rest stay as-is. Other letters are not forced to lowercase.
  3. Not title case. Small words like “of” or “the” still get capitalized if they start a word.
  4. For true titles. Write proper casing in the content when rules are language-specific.

Example 3 — All Lowercase

Force every letter to lowercase.

CSS
<style>
  p {
    text-transform: lowercase;
  }
</style>

<p>CSS Text Transform Sample</p>
Try It Yourself

How It Works

  1. Start with mixed case. Here the markup uses capitals on purpose.
  2. Apply lowercase. Display maps letters to their lowercase forms.
  3. Inherited tip. A parent value flows to children unless overridden.
  4. Reset tip. none or initial restores source casing.

Edge Cases & Pitfalls

If casing looks wrong, one of these is usually why.

source

Display only—DOM stays original

Copy/paste, form values, and many screen readers still use the source string. Do not store meaning only in the transformed look.

capitalize

capitalize is not smart title case

It capitalizes the first letter of each word and does not lower the rest. Language-aware title casing still belongs in the content.

i18n

Locale casing can surprise you

Some languages have special uppercase/lowercase rules (for example Turkish dotted/dotless i). Test with real locales when it matters.

limited

full-width / full-size-kana / math-auto

These values are niche and unevenly supported. Prefer MathML for math, and treat East Asian transforms as progressive enhancement.

caps

All caps is harder to read

Long uppercase paragraphs hurt readability. Reserve uppercase for short UI text, not body copy.

Browser Support

text-transform is a browser CSS property for display casing. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available since Jul 2015

text-transform

none / capitalize / uppercase / lowercase: all modern browsers and IE. full-width & full-size-kana: Firefox and Safari. math-auto: Chrome/Edge 109+, Firefox 117+ (not Safari).

97% Common keywords support
Google Chrome 1+ common
Full support
Mozilla Firefox 1+ common
Full support
Apple Safari 1+ common
Full support
Microsoft Edge 12+ common
Full support
Opera Common long
Full support
Samsung Internet Common long
Full support
Internet Explorer Common keywords
Full support
text-transform Widely supported

Bottom line: Safe for everyday casing. Treat full-width, full-size-kana, and math-auto as optional enhancements.

Key Takeaways

  • Role: changes display capitalization without editing the source text.
  • Common values: none, uppercase, lowercase, capitalize.
  • Initial value: none. The property is inherited.
  • Pitfall: capitalize is not language-aware title case.

One line: keep natural casing in HTML; use text-transform when the design needs a consistent display style.

Frequently Asked Questions

It changes how text is capitalized for display: uppercase, lowercase, capitalize each word, or none. The source HTML text stays the same.
none. Characters keep the casing written in the markup or content.
No. capitalize uppercases only the first letter of each word. Use uppercase for all letters.
Yes. A value on a parent applies to children unless a child sets its own value.
No. It is visual only. Copying text or reading the DOM still shows the original casing.
none, capitalize, uppercase, and lowercase are universal in modern browsers. full-width and full-size-kana have limited support. math-auto is newer and mainly for MathML. It is a browser CSS property, not a Node.js feature.

Next: text-underline-offset

Learn how to move an underline away from the glyphs.

text-underline-offset 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