Skip to main content

Tailwind CSS Text Transform Cheatsheet

Complete reference for Tailwind v4 text-transform utilities.
Click any example to copy the class name.

All Text Transform Classes

Four utilities for controlling text capitalization

Interactive Demo

Type your own text to see how each transform affects it

Side-by-Side Comparison

Original Textuppercaselowercasecapitalize
Hello WorldHello WorldHello WorldHello World
ALREADY CAPSALREADY CAPSALREADY CAPSALREADY CAPS
already loweralready loweralready loweralready lower
mIxEd CaSemIxEd CaSemIxEd CaSemIxEd CaSe

Note: capitalize only affects the first letter of each word. It does not lowercase the rest.

Common Use Cases

Navigation Links

<nav>
  <a class="uppercase tracking-wide
    text-sm font-semibold">
    Home
  </a>
  <a class="uppercase tracking-wide
    text-sm font-semibold">
    About
  </a>
</nav>

Button Labels

<button class="uppercase
  font-bold tracking-wider
  px-6 py-3 bg-primary">
  Submit Form
</button>

Section Headings

<h2 class="uppercase text-xs
  font-bold tracking-widest
  text-gray-500 mb-4">
  Latest Articles
</h2>

Title Case Names

{/* User input normalization */}
<span class="capitalize">
  {userName.toLowerCase()}
</span>

{/* Result: "john doe" → "John Doe" */}

Email Addresses

<a href="mailto:..."
  class="lowercase text-primary">
  Contact@Example.COM
</a>

{/* Displays: contact@example.com */}

Reset Inherited Transform

<div class="uppercase">
  ALL CAPS SECTION
  <span class="normal-case">
    But this is normal
  </span>
</div>

Responsive & State Variants

Apply text transforms conditionally with Tailwind's variant prefixes:

<h2 class="uppercase md:normal-case">
Uppercase on mobile, normal on medium screens and up
<button class="lowercase hover:uppercase">
Lowercase by default, uppercase on hover
<input class="normal-case focus:uppercase" />
Normal by default, uppercase when focused

Quick Reference

ClassCSS PropertyEffect
uppercasetext-transform: uppercase;ALL CHARACTERS BECOME UPPERCASE
lowercasetext-transform: lowercase;all characters become lowercase
capitalizetext-transform: capitalize;First Letter Of Each Word
normal-casetext-transform: none;Preserves original casing

Frequently Asked Questions

What text transform classes are available in Tailwind CSS?

Tailwind CSS provides four text-transform utilities: uppercase (all caps), lowercase (all lowercase), capitalize (first letter of each word capitalized), and normal-case (preserves original casing, useful for resetting).

How do I make text uppercase in Tailwind CSS?

Add the uppercase class to your element: <span class="uppercase">hello</span> will display as "HELLO". This is commonly used for navigation links, buttons, and section headings.

What does capitalize do in Tailwind CSS?

The capitalize class capitalizes the first letter of each word. However, it only transforms the first character of each word to uppercase - it does not lowercase the remaining characters. So "hELLO wORLD" becomes "HELLO WORLD", not "Hello World".

When should I use normal-case in Tailwind?

Use normal-case to reset any inherited text-transform styles. This is useful when a parent element has uppercase or capitalize applied, but you want a child element to display in its original casing.

Can I apply text transform on hover or other states?

Yes! Use Tailwind's state variants like hover:uppercase or focus:capitalize. For example: <button class="lowercase hover:uppercase">hover me</button> will show uppercase text on hover.

What is the difference between CSS text-transform and JavaScript toLowerCase()?

CSS text-transform (like Tailwind's uppercase class) only changes the visual display without modifying the actual text data. JavaScript's toLowerCase() actually changes the string value. Use CSS for styling and JavaScript for data manipulation.