Skip to content
Dev Utilities

Tailwind Cheat Sheet

Tailwind cheat sheet: a searchable reference for Tailwind CSS utility classes and the exact CSS each one produces.

  • #tailwind cheat sheet
  • #tailwind css classes
  • #tailwind reference
  • #tailwind
  • #cheatsheet
  • #css
  • #utility classes
  • #reference
100% client-side

Runs in your browser. Your data never leaves this device.

The Workbench
Tailwind Cheat Sheet — workspaceLive
Class
CSS
sm:e.g. sm:flex
@media (min-width: 640px)
md:e.g. md:grid-cols-2
@media (min-width: 768px)
lg:e.g. lg:px-8
@media (min-width: 1024px)
xl:e.g. xl:max-w-6xl
@media (min-width: 1280px)
2xl:e.g. 2xl:text-lg
@media (min-width: 1536px)
Class
CSS
block
display: block
inline-block
display: inline-block
inline
display: inline
flex
display: flex
inline-flex
display: inline-flex
grid
display: grid
inline-grid
display: inline-grid
hidden
display: none
contents
display: contents
Class
CSS
static
position: static
fixed
position: fixed
absolute
position: absolute
relative
position: relative
sticky
position: sticky
inset-0
inset: 0
inset-x-0
left: 0; right: 0
inset-y-0
top: 0; bottom: 0
top-0
top: 0
right-0
right: 0
bottom-0
bottom: 0
left-0
left: 0
Class
CSS
flex-row
flex-direction: row
flex-col
flex-direction: column
flex-wrap
flex-wrap: wrap
flex-nowrap
flex-wrap: nowrap
flex-1
flex: 1 1 0%
flex-auto
flex: 1 1 auto
flex-none
flex: none
grow
flex-grow: 1
grow-0
flex-grow: 0
shrink
flex-shrink: 1
shrink-0
flex-shrink: 0
Class
CSS
grid-cols-1
grid-template-columns: repeat(1, minmax(0, 1fr))
grid-cols-2
grid-template-columns: repeat(2, minmax(0, 1fr))
grid-cols-3
grid-template-columns: repeat(3, minmax(0, 1fr))
grid-cols-4
grid-template-columns: repeat(4, minmax(0, 1fr))
grid-cols-12
grid-template-columns: repeat(12, minmax(0, 1fr))
col-span-1
grid-column: span 1 / span 1
col-span-2
grid-column: span 2 / span 2
col-span-full
grid-column: 1 / -1
grid-rows-1
grid-template-rows: repeat(1, minmax(0, 1fr))
grid-rows-2
grid-template-rows: repeat(2, minmax(0, 1fr))
Class
CSS
justify-start
justify-content: flex-start
justify-center
justify-content: center
justify-end
justify-content: flex-end
justify-between
justify-content: space-between
justify-around
justify-content: space-around
justify-evenly
justify-content: space-evenly
items-start
align-items: flex-start
items-center
align-items: center
items-end
align-items: flex-end
items-baseline
align-items: baseline
items-stretch
align-items: stretch
self-auto
align-self: auto
self-start
align-self: flex-start
self-center
align-self: center
self-end
align-self: flex-end
Class
CSS
p-0
padding: 0
p-1
padding: 0.25rem (4px)
p-2
padding: 0.5rem (8px)
p-4
padding: 1rem (16px)
p-6
padding: 1.5rem (24px)
p-8
padding: 2rem (32px)
px-*
padding-left & padding-right
py-*
padding-top & padding-bottom
pt/pr/pb/pl-*
padding-[side]
m-0
margin: 0
m-1
margin: 0.25rem (4px)
m-2
margin: 0.5rem (8px)
m-4
margin: 1rem (16px)
m-auto
margin: auto
-m-1
margin: -0.25rem
mx-auto
margin-left: auto; margin-right: auto
gap-0
gap: 0
gap-1
gap: 0.25rem (4px)
gap-2
gap: 0.5rem (8px)
gap-4
gap: 1rem (16px)
gap-x-*
column-gap
gap-y-*
row-gap
Class
CSS
w-0
width: 0
w-1
width: 0.25rem (4px)
w-4
width: 1rem (16px)
w-full
width: 100%
w-screen
width: 100vw
w-auto
width: auto
w-1/2
width: 50%
w-1/3
width: 33.333%
w-fit
width: fit-content
min-w-0
min-width: 0
min-w-full
min-width: 100%
max-w-sm
max-width: 24rem (384px)
max-w-md
max-width: 28rem (448px)
max-w-lg
max-width: 32rem (512px)
max-w-xl
max-width: 36rem (576px)
max-w-2xl
max-width: 42rem (672px)
max-w-full
max-width: 100%
max-w-screen-sm
max-width: 640px
max-w-screen-md
max-width: 768px
max-w-screen-lg
max-width: 1024px
h-0
height: 0
h-4
height: 1rem (16px)
h-full
height: 100%
h-screen
height: 100vh
h-auto
height: auto
min-h-0
min-height: 0
min-h-full
min-height: 100%
min-h-screen
min-height: 100vh
size-4
width: 1rem; height: 1rem
size-6
width: 1.5rem; height: 1.5rem
size-full
width: 100%; height: 100%
Class
CSS
text-xs
font-size: 0.75rem (12px)
text-sm
font-size: 0.875rem (14px)
text-base
font-size: 1rem (16px)
text-lg
font-size: 1.125rem (18px)
text-xl
font-size: 1.25rem (20px)
text-2xl
font-size: 1.5rem (24px)
text-3xl
font-size: 1.875rem (30px)
text-4xl
font-size: 2.25rem (36px)
font-thin
font-weight: 100
font-light
font-weight: 300
font-normal
font-weight: 400
font-medium
font-weight: 500
font-semibold
font-weight: 600
font-bold
font-weight: 700
font-sans
font-family: ui-sans-serif, system-ui, sans-serif
font-serif
font-family: ui-serif, Georgia, serif
font-mono
font-family: ui-monospace, monospace
italic
font-style: italic
not-italic
font-style: normal
leading-none
line-height: 1
leading-tight
line-height: 1.25
leading-normal
line-height: 1.5
leading-relaxed
line-height: 1.625
leading-loose
line-height: 2
tracking-tight
letter-spacing: -0.025em
tracking-normal
letter-spacing: 0
tracking-wide
letter-spacing: 0.025em
Class
CSS
text-left
text-align: left
text-center
text-align: center
text-right
text-align: right
text-justify
text-align: justify
uppercase
text-transform: uppercase
lowercase
text-transform: lowercase
capitalize
text-transform: capitalize
normal-case
text-transform: none
underline
text-decoration: underline
line-through
text-decoration: line-through
no-underline
text-decoration: none
truncate
overflow: hidden; text-overflow: ellipsis; white-space: nowrap
text-ellipsis
text-overflow: ellipsis
text-clip
text-overflow: clip
whitespace-normal
white-space: normal
whitespace-nowrap
white-space: nowrap
whitespace-pre
white-space: pre
break-normal
word-break: normal
break-words
word-break: break-word
break-all
word-break: break-all
line-clamp-1
-webkit-line-clamp: 1
line-clamp-2
-webkit-line-clamp: 2
line-clamp-3
-webkit-line-clamp: 3
Class
CSS
bg-transparent
background-color: transparent
bg-current
background-color: currentColor
bg-white
background-color: #fff
bg-black
background-color: #000
bg-slate-500
background-color: #64748b
bg-[#hex]e.g. bg-[#1da1f2]
background-color: #hex
bg-cover
background-size: cover
bg-contain
background-size: contain
bg-center
background-position: center
bg-no-repeat
background-repeat: no-repeat
bg-repeat
background-repeat: repeat
bg-fixed
background-attachment: fixed
bg-gradient-to-r
background-image: linear-gradient(to right, ...)
bg-gradient-to-b
background-image: linear-gradient(to bottom, ...)
from-blue-500
gradient start color
via-purple-500
gradient middle color
to-pink-500
gradient end color
Class
CSS
border
border-width: 1px
border-0
border-width: 0
border-2
border-width: 2px
border-4
border-width: 4px
border-t
border-top-width: 1px
border-r
border-right-width: 1px
border-b
border-bottom-width: 1px
border-l
border-left-width: 1px
border-solid
border-style: solid
border-dashed
border-style: dashed
border-dotted
border-style: dotted
border-none
border-style: none
rounded
border-radius: 0.25rem (4px)
rounded-md
border-radius: 0.375rem (6px)
rounded-lg
border-radius: 0.5rem (8px)
rounded-xl
border-radius: 0.75rem (12px)
rounded-2xl
border-radius: 1rem (16px)
rounded-full
border-radius: 9999px
rounded-[10px]
border-radius: 0
rounded-t-lg
border-top-left/right-radius: 0.5rem
divide-x
border between horizontal children
divide-y
border between vertical children
Class
CSS
shadow-sm
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05)
shadow
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1)
shadow-md
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1)
shadow-lg
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1)
shadow-xl
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1)
shadow-2xl
box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25)
shadow-inner
box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05)
shadow-none
box-shadow: none
opacity-0
opacity: 0
opacity-50
opacity: 0.5
opacity-100
opacity: 1
blur
filter: blur(8px)
blur-sm
filter: blur(4px)
blur-lg
filter: blur(16px)
blur-none
filter: blur(0)
backdrop-blur
backdrop-filter: blur(8px)
backdrop-blur-sm
backdrop-filter: blur(4px)
Class
CSS
transition
transition: all 150ms ease
transition-none
transition: none
transition-colors
transition: color, background-color, border-color
transition-opacity
transition: opacity 150ms
transition-transform
transition: transform 150ms
duration-75
transition-duration: 75ms
duration-150
transition-duration: 150ms
duration-300
transition-duration: 300ms
duration-500
transition-duration: 500ms
ease-linear
transition-timing-function: linear
ease-in
transition-timing-function: ease-in
ease-out
transition-timing-function: ease-out
ease-in-out
transition-timing-function: ease-in-out
delay-150
transition-delay: 150ms
delay-300
transition-delay: 300ms
animate-spin
animation: spin 1s linear infinite
animate-ping
animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite
animate-pulse
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite
animate-bounce
animation: bounce 1s infinite
Class
CSS
scale-0
transform: scale(0)
scale-50
transform: scale(0.5)
scale-100
transform: scale(1)
scale-150
transform: scale(1.5)
rotate-0
transform: rotate(0deg)
rotate-45
transform: rotate(45deg)
rotate-90
transform: rotate(90deg)
rotate-180
transform: rotate(180deg)
-rotate-45
transform: rotate(-45deg)
translate-x-0
transform: translateX(0)
translate-x-4
transform: translateX(1rem)
translate-x-full
transform: translateX(100%)
-translate-x-4
transform: translateX(-1rem)
translate-y-4
transform: translateY(1rem)
skew-x-3
transform: skewX(3deg)
skew-y-3
transform: skewY(3deg)
origin-center
transform-origin: center
origin-top
transform-origin: top
Class
CSS
cursor-pointer
cursor: pointer
cursor-default
cursor: default
cursor-not-allowed
cursor: not-allowed
cursor-wait
cursor: wait
cursor-grab
cursor: grab
pointer-events-none
pointer-events: none
pointer-events-auto
pointer-events: auto
select-none
user-select: none
select-text
user-select: text
select-all
user-select: all
resize
resize: both
resize-none
resize: none
resize-x
resize: horizontal
resize-y
resize: vertical
scroll-smooth
scroll-behavior: smooth
scroll-auto
scroll-behavior: auto
Class
CSS
hover:e.g. hover:bg-blue-600
on mouse hover
focus:e.g. focus:ring-2
on focus
focus-visible:e.g. focus-visible:outline-none
on keyboard focus
active:e.g. active:bg-blue-700
on active/pressed
disabled:e.g. disabled:opacity-50
when disabled
first:e.g. first:mt-0
first child
last:e.g. last:mb-0
last child
odd:e.g. odd:bg-gray-100
odd children
even:e.g. even:bg-white
even children
group-hover:e.g. group-hover:visible
when parent .group is hovered
peer-focus:e.g. peer-focus:ring
when sibling .peer is focused
dark:e.g. dark:bg-gray-900
dark mode
motion-safe:e.g. motion-safe:animate-spin
if user allows motion
motion-reduce:e.g. motion-reduce:animate-none
if user prefers reduced motion
Class
CSS
overflow-auto
overflow: auto
overflow-hidden
overflow: hidden
overflow-visible
overflow: visible
overflow-scroll
overflow: scroll
overflow-x-auto
overflow-x: auto
overflow-y-auto
overflow-y: auto
overflow-x-hidden
overflow-x: hidden
overflow-y-hidden
overflow-y: hidden
z-0
z-index: 0
z-10
z-index: 10
z-20
z-index: 20
z-30
z-index: 30
z-40
z-index: 40
z-50
z-index: 50
z-auto
z-index: auto
-z-10
z-index: -10
Tip: Use arbitrary values with square brackets: w-[200px], text-[#1da1f2], grid-cols-[1fr_2fr]
Network requests0
Bytes uploaded0
Trackers fired0
The Guide

About Tailwind Cheat Sheet

/01 A searchable map of Tailwind to CSS

Tailwind CSS is built from utility classes: small, single-purpose class names that each emit one piece of CSS. Learn the naming pattern and you can style almost anything without leaving your HTML. The catch is that the pattern has to be learned, and the class names are not always what you would guess.

This cheat sheet is a searchable reference that pairs every utility class with the CSS it actually generates. Search for a class name and see its declaration. Search for a CSS property and find the class that produces it. Either direction works, which covers both halves of the job: confirming what a class does before you ship it, and finding the class for something you know you want.

The copy button puts the class on your clipboard ready to paste into markup. When you half-remember a class name, a partial search finds it faster than scrolling documentation, and the generated CSS beside it confirms you found the right one.

/02 Why seeing the CSS matters

Tailwind classes are a thin layer over ordinary CSS, and the reference shows the declaration under every class. That single piece of visibility removes most of the guesswork from working with the framework.

It is most useful for the classes whose names are not obvious. The spacing scale maps numbered steps to rem values. The flex and grid shorthands carry a lot of meaning in few letters. The ring and divide utilities do things that their names only hint at. For all of these, seeing the emitted declaration is faster than holding the mapping in your head.

It also settles the questions that debugging raises. When two classes both set the same property, the one that wins is decided by the order in the stylesheet, not the order you wrote them in your markup. Seeing the declarations makes those collisions obvious before they become bugs.

/03 The naming pattern, once you see it

Most of Tailwind follows a small number of naming rules, and the cheat sheet makes them visible by grouping. Variants come first: hover, focus, and responsive breakpoints attach to the front of a class and make it apply only under that condition. Then comes the property, usually shortened: p for padding, m for margin, w for width, text for font size and colour, bg for backgrounds.

Then comes the value. Some values are on a numbered scale, like spacing and font sizes. Some are named, like the colour palette. Some are literal, like fractional widths or arbitrary values written in square brackets.

Once the pattern is visible, unfamiliar classes become readable instead of opaque. You stop memorising classes and start reading them, which is the whole point of a utility framework: the name tells you what it does, and the reference is there to check.

/04 When a class does not apply

The most common Tailwind problem is a class that appears in markup and does nothing. There are three usual causes, and the cheat sheet helps spot the first two.

One: another class or stylesheet rule sets the same property with higher specificity. The emitted CSS in the reference shows what the class is fighting against. Two: the class was built by joining strings together in your code. Tailwind's scanner reads your source files for complete class names, so a class assembled at runtime is invisible to it and never gets generated. Write the full class name somewhere it can be seen, or safelist it.

Three: the class exists in a different version of Tailwind than the one in your project. Names and configuration changed between v3 and v4, so if a class looks unfamiliar or a search comes up empty, check the version your project runs.

Note that the reference covers the standard utilities. Arbitrary value syntax, the square-bracket form for one-off values, works alongside these but is not something a static reference can enumerate.

/05 Using a Tailwind cheat sheet to learn faster

Nobody memorises every Tailwind class, and the official documentation, while thorough, is organised by topic rather than by what you are trying to find. A Tailwind cheat sheet flips that around: search for the CSS you already know, such as justify-content or letter-spacing, and see the utilities that produce it.

The fastest way to learn is to search in both directions. When you meet an unfamiliar class in someone else's code, look it up to see its CSS. When you know the CSS you want, search the property to find its class. After a few days the naming patterns click, and you stop needing to look things up for the common utilities.

Keep it open in a tab while you build. It is quicker than switching to the docs, and because it shows the actual CSS, it doubles as a reminder of how each property behaves.

FAQ

Questions about Tailwind Cheat Sheet.

What is a Tailwind cheat sheet for?
It pairs every utility class with the CSS it generates, searchable by class name or by CSS property. You can confirm what a class does before using it, or find the class that produces an effect you already know you want.
How do I find the Tailwind class for a CSS property?
Search for the property or effect you want — padding, blur, flex — and the matching classes appear with their generated CSS. Searching works from either end: class to CSS, or CSS to class.
Why is my utility class not applying?
Usually another class setting the same property, a specificity conflict with existing CSS, or a class assembled from string concatenation that Tailwind's scanner cannot see. Seeing the emitted declaration makes the collision obvious.
How is Tailwind spacing calculated?
The numbered spacing scale maps to rem values, with each step a multiple of the base. Search a spacing class in the reference and the exact rem value it emits is shown beside it, which is faster than holding the scale in your head.
Does the reference cover arbitrary values?
The standard utilities and their generated CSS are covered. Arbitrary value syntax, written in square brackets, is for one-off values that no preset fits and is generated per-project rather than listed in a static reference.
Which Tailwind version does this reflect?
The utility names and generated CSS follow current Tailwind. Some class names and the configuration format changed between v3 and v4, so check against your project's version if something looks unfamiliar.
What are the most used Tailwind classes?
Layout and spacing dominate: flex, grid, items-center, justify-between, gap, p and m spacing, w and h sizing, text size and colour, font-bold, rounded, border and shadow. Learning those covers most everyday layouts.
How do I center a div in Tailwind?
Use flex items-center justify-center on the parent, or grid place-items-center. To centre a block horizontally only, give it a width and mx-auto.
What does sm, md and lg mean in Tailwind?
They are responsive breakpoints that apply a class from that screen width upward: sm is 40rem (640px), md 48rem (768px), lg 64rem (1024px), xl 80rem (1280px) and 2xl 96rem (1536px). Unprefixed classes apply to all sizes, so design mobile first.
Related