0px
0px
0px
800px
0deg
0deg
18deg
1
1
0deg
0deg
50%
50%

Everything rotates and scales around this point. Move it to a corner and a rotation swings instead of spinning.

Preview
Transform me
Your CSS

                

                

About the CSS Transform Generator

What is a CSS transform generator?

The transform property moves, turns, resizes and slants an element without disturbing anything around it. That last part is the whole point. A transformed element leaves its original space in the layout untouched, so nothing reflows and the browser can hand the work to the GPU. It is why transforms are the right tool for animation and margins are not.

Writing one by hand is fiddly because the functions are order dependent and 3D needs a perspective value before it looks like anything. This tool gives every function a slider, shows the result on a real element, and warns you when you've asked for a 3D rotation with no perspective set, which is the single most common reason a flip looks flat.

How to Use This Tool

  1. Pick a preset. Tilt and Floating card are 3D, Pop on hover is the standard button lift, Isometric is the rotate-plus-skew trick.
  2. Move it. Across and Down slide the element. Toward you needs perspective to be visible.
  3. Turn it. Flat on the page is the everyday 2D rotation. Tip forward and Turn sideways are the 3D axes.
  4. Scale and skew. A negative width scale mirrors the element. Skew slants it, which is how you fake italic boxes and parallelograms.
  5. Move the anchor. Drag the anchor point to a corner and a rotation becomes a swing rather than a spin.
  6. Copy it. CSS, an SCSS mixin, a Tailwind class or a JS style object.

Common Use Cases

Transforms turn up wherever something needs to move without the page moving with it.

  • Hover states: A small lift and scale on a card or button, which animates smoothly because no layout is involved.
  • Card flips: A 180 degree turn on the Y axis with perspective, usually paired with backface-visibility: hidden.
  • Centering the old way: translate(-50%, -50%) on an absolutely positioned element, still the shortest way to center something of unknown size.
  • Isometric mockups: A rotation combined with a skew gives the tilted 3D look used in product shots without any real 3D.
  • Mirroring icons: A width scale of -1 flips an arrow or chevron instead of shipping a second asset.

Animating what you build here? Pair it with the CSS Box Shadow Generator for the lift, or reshape the element first with the CSS Border Radius Generator. Or browse all our free developer tools.

Frequently Asked Questions

Does the order of transform functions matter?

Yes, and it catches people out constantly. Transforms apply right to left, each one operating in the coordinate space the previous one left behind. rotate(45deg) translateX(100px) moves the element 100px along its own rotated axis, so it ends up diagonally offset. translateX(100px) rotate(45deg) moves it 100px right, then spins it in place. This tool always writes the functions in a consistent order, so what you see in the preview is what the code produces.

Why does my 3D rotation look flat?

Because there's no perspective. Without it the browser projects the element orthographically, so a Y rotation just squashes it horizontally instead of turning away from you. Set a perspective value and depth appears. Lower numbers mean a more extreme, wide-angle effect; 800px to 1200px looks natural for a card.

Should I set perspective on the element or the parent?

Both work, and they do different things. The perspective() function inside transform, which is what this tool generates, applies a vanishing point to that one element. The perspective property on a parent gives all its children a shared vanishing point, so a row of cards tilts as though you're looking at one scene. Use the property on the parent when several elements need to feel like they're in the same space.

What does transform-origin change?

It moves the point everything pivots and scales around. The default is the center of the element. Set it to 0% 0% and a rotation swings from the top left corner like a hinge, and a scale grows out from that corner rather than in all directions. It's the difference between a door opening and a record spinning.

Are transforms good for animation?

They're the best option, along with opacity. Because a transform doesn't affect layout, the browser can skip layout and paint work and composite the change on the GPU, which is what keeps an animation at 60fps. Animating left, top, width or margin forces a layout recalculation on every frame and is the usual cause of jank.

Can I use this transform in Tailwind?

Yes. Switch the format above the code and you get an arbitrary-value class holding the whole transform. Tailwind does ship separate utilities for rotate, scale and translate, but they compose through its own CSS variables, so for a multi-function transform like the ones here a single arbitrary value is more predictable.