Home › Developer Tools › Tailwind CSS Cheat Sheet

Tailwind CSS Cheat Sheet

Search any Tailwind utility and see the exact CSS it generates, with live previews for shadows, radius, type and filters. Type a full class such as md:hover:bg-blue-500/50 or -mt-4 to decode it, and copy colors from the complete palette.

Last updated:

Try:

Values from the Tailwind CSS v3.4 default theme ( classes). Click a class to copy it. Utilities renamed in v4 are marked.

Advertisement
Advertisement

How to use the Tailwind CSS Cheat Sheet

  1. Search by class name or CSS property, for example justify-between, padding, shadow or grid-cols.
  2. Decode a class by typing it exactly, including variants (md:hover:), a minus for negatives, opacity (/50) or arbitrary values (w-[37px]).
  3. Browse by category with the tabs, and press Show all to expand long scales such as spacing.
  4. Copy a class by clicking it, or press Copy CSS to take the plain CSS.
  5. Pick colors in the Colors tab: choose a utility prefix or a format such as HEX or OKLCH and click a swatch.

Tailwind spacing scale in rem and pixels

Spacing utilities (padding, margin, gap, width, height, inset, translate) share one scale. One step is 0.25rem, which equals 4px when the root font size is 16px.

Class suffixrempxClass suffixrempx
00082rem32px
px—1px102.5rem40px
0.50.125rem2px123rem48px
10.25rem4px164rem64px
20.5rem8px205rem80px
30.75rem12px246rem96px
41rem16px328rem128px
51.25rem20px4812rem192px
61.5rem24px6416rem256px
71.75rem28px9624rem384px

Responsive breakpoints

PrefixMin widthCSS
sm:640px@media (min-width: 640px)
md:768px@media (min-width: 768px)
lg:1024px@media (min-width: 1024px)
xl:1280px@media (min-width: 1280px)
2xl:1536px@media (min-width: 1536px)

Breakpoints are mobile first: style the small screen without a prefix, then override upward, for example flex-col md:flex-row. Use max-md: to target only screens narrower than 768px.

Renamed utilities in Tailwind CSS v4

v3v4
shadow-sm / shadowshadow-xs / shadow-sm
rounded-sm / roundedrounded-xs / rounded-sm
blur-sm / blurblur-xs / blur-sm
drop-shadow-sm / drop-shadowdrop-shadow-xs / drop-shadow-sm
outline-noneoutline-hidden (outline-none now sets outline-style: none)
ring (3px)ring-3; plain ring is 1px
bg-gradient-to-rbg-linear-to-r
flex-grow / flex-shrinkgrow / shrink
bg-opacity-50bg-black/50 (opacity modifier)

In v4 the default border color also changed from gray-200 to currentColor, and theme values are defined in CSS with @theme instead of tailwind.config.js.

Frequently asked questions

What is the Tailwind spacing scale?

In the default theme one unit is 0.25rem, which is 4px at the default 16px font size. So p-1 is 4px, p-4 is 1rem (16px), p-8 is 2rem (32px) and p-px is exactly 1px. The scale runs from 0 to 96 (24rem, 384px) with half steps such as 0.5, 1.5, 2.5 and 3.5.

What are Tailwind's default breakpoints?

sm is 640px, md 768px, lg 1024px, xl 1280px and 2xl 1536px. They are min-width media queries, so Tailwind is mobile first: an unprefixed class applies at every size and md:flex applies from 768px wide and up.

How do I use a value that is not in the Tailwind scale?

Use square brackets for an arbitrary value, such as w-[37px], top-[117px], bg-[#1da1f2] or grid-cols-[200px_1fr] (underscores become spaces). For a property Tailwind has no utility for, write [mask-type:luminance].

What changed in Tailwind CSS v4?

Version 4 moves configuration into CSS with @theme, uses OKLCH colors and computes spacing from a single --spacing variable. Several utilities were renamed: shadow-sm became shadow-xs and shadow became shadow-sm, the same shift applies to rounded, blur and drop-shadow, outline-none became outline-hidden, and the default ring width changed from 3px to 1px (use ring-3).

How do I make a negative margin in Tailwind?

Put a minus sign in front of the class: -mt-4 gives margin-top: -1rem and -translate-x-1/2 gives translateX(-50%). Negative values work for margin, inset (top, left…), translate, rotate, skew, z-index, order, text-indent and space-between.

How does the opacity modifier work on colors?

Add a slash and a number from 0 to 100 to any color utility: bg-black/50 is black at 50% opacity and text-blue-500/75 is 75%. It replaces the older bg-opacity-* utilities, which were removed in v4.

Are these values for Tailwind v3 or v4?

Class names and CSS follow the default theme of Tailwind CSS v3.4, which most projects and tutorials still use. Utilities renamed in v4 are marked, and the color palette can be copied in the v4 OKLCH format. Your project may also extend or change the theme in its configuration.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Tailwind Color GeneratorTurn one color into a full Tailwind 50–950 shade scale and export the config or CSS.CSS Box Shadow GeneratorDesign layered CSS box shadows with a live preview, presets and one-click Copy CSS.PX to REM ConverterConvert px to rem or em and back, with a 1-100px table and a whole-CSS converter.CSS Flexbox GeneratorBuild flexbox layouts visually: set container and item properties, then copy the CSS and HTML.Open Graph PreviewPaste OG tags and preview how links look on Facebook, X and LinkedIn.YouTube Embed Code GeneratorCreate responsive YouTube embed code with start time, autoplay, loop and privacy mode.CSS Border Radius GeneratorRound each corner, draw elliptical 8-value radii or random blob shapes and copy the CSS.CSS Button GeneratorDesign CSS buttons with gradients, borders, shadows and hover and active states, then copy the code.Twitter Card GeneratorCreate X / Twitter Card meta tags with Open Graph fallbacks, character counters and a live preview.CSS Grid GeneratorDraw CSS grid layouts: set tracks and gaps, drag to name areas, then copy the CSS and HTML.Glassmorphism CSS GeneratorDesign frosted-glass UI cards with blur, transparency and border sliders, then copy the CSS.CSS Text Shadow GeneratorLayer CSS text shadows with a live preview and neon, 3D, outline and retro presets.HTML Editor (Live Preview)Write HTML, CSS and JavaScript and see a live, sandboxed preview as you type.HTML to JSX ConverterConvert HTML to valid React JSX: className, htmlFor, style objects, self-closing tags and events.CSS Clip-Path GeneratorDraw CSS clip-path shapes by dragging points: polygons, circle, ellipse and inset. Copy the CSS.CSS Animation GeneratorCreate CSS keyframe animations from 23 presets with live preview, timing controls and Copy CSS.CSS Triangle GeneratorMake CSS triangles in 8 directions with the border trick or clip-path. Set size and color, copy CSS.CSS Loader GeneratorPick from 14 pure CSS spinners and loaders, set color, size and speed, then copy the HTML and CSS.Cubic Bezier GeneratorDrag the control points to design a CSS easing curve, compare it with linear and copy cubic-bezier().CSS Filter GeneratorAdjust blur, brightness, contrast, hue, sepia and drop-shadow on an image and copy the CSS filter.CSS Specificity CalculatorCalculate CSS selector specificity (a, b, c), including :is(), :not(), :has() and :where(), and compare.Google Maps Embed GeneratorTurn an address or coordinates into responsive Google Maps iframe embed code, no API key.Neumorphism CSS GeneratorDesign soft UI neumorphic shapes with live preview and copy the box-shadow CSS.SVG Wave GeneratorMake layered SVG waves for section dividers and export SVG, PNG or a CSS background.SVG Blob GeneratorGenerate random organic SVG blob shapes with gradients and export SVG, PNG or CSS clip-path.CSS Clamp GeneratorTurn min/max sizes and viewport widths into a fluid CSS clamp() value in rem and vw.CSS @font-face GeneratorTurn font files or URLs into ready-to-paste @font-face rules with weights, styles and a preview.CSS Media Query GeneratorBuild @media rules for widths, orientation, dark mode and hover, or get framework breakpoints.CSS Scrollbar GeneratorStyle scrollbars: width, colors, radius and hover, with ::-webkit-scrollbar and scrollbar-color CSS.CSS Sprite GeneratorPack many icons into one sprite sheet PNG and get CSS classes with background-position.CSS Text Gradient GeneratorMake gradient text with background-clip:text: color stops, angle, font preview and fallback CSS.CSS Toggle Switch GeneratorDesign pure-CSS toggle switches: size, colors, shape and animation. Copy accessible HTML + CSS.CSS Tooltip GeneratorBuild pure CSS tooltips: position, arrow, colors, padding and animation. Copy HTML and CSS.HTML Form BuilderDrag and drop form fields with labels and validation, then copy accessible HTML and CSS code.Iframe GeneratorCreate iframe embed code: size or responsive ratio, border, allow, sandbox, lazy load, live preview.PX to VW ConverterConvert pixels to vw and vh for any viewport size, and vw/vh back to px, with breakpoint tables.SVG Path EditorEdit an SVG path d attribute visually: drag points, edit commands, convert, scale and minify.SVG to CSS Data URITurn SVG code into a small URL-encoded data URI for CSS backgrounds, with Base64 size comparison.Web App Manifest GeneratorCreate a PWA manifest.json and every app icon size from one image, downloaded as a ZIP.CSS Background Pattern GeneratorMake pure-CSS stripes, dots, checkerboard, zigzag and grid backgrounds and copy the code.CSS Color Filter GeneratorTurn a HEX color into a CSS filter that recolors black icons and SVGs, with an accuracy score.CSS Gradient Animation GeneratorCreate animated gradient backgrounds: pick colors, angle and speed, preview live and copy the CSS.CSS Hover Effects GeneratorPick button, link and image hover effects, tweak colors and timing, and copy the HTML and CSS.CSS InlinerMove CSS from style blocks into inline style attributes so HTML emails render in every client.CSS Shape Divider GeneratorCreate wave, tilt, curve and triangle section dividers and copy the SVG, HTML and CSS.CSS Transform GeneratorRotate, scale, skew and translate an element with sliders and copy the CSS transform code.Font Pairing ToolPreview Google Font heading and body pairs on real layouts and copy the embed code and CSS.HTML Accessibility CheckerPaste HTML to find WCAG accessibility problems with impact level, the failing element and a fix.HTML Image Map GeneratorDraw clickable rectangle, circle and polygon hotspots on an image and get image map HTML.SVG ViewerOpen or paste SVG code to preview it live with zoom, backgrounds, size info and PNG export.Pathfinding VisualizerAnimate BFS, DFS, Dijkstra, A* and greedy search on a grid with walls, weights and mazes.SVG to JSXTurn SVG code into a clean React component: camelCase attributes, style objects, TypeScript.
See all 52 Web, HTML & CSS Tools →