CSS Transform Generator
Controls
Preview & CSS
How to Use
- Rotate — Drag the rotation slider or type a degree value to spin the element around its origin.
- Scale — Adjust X and Y scale independently to stretch, shrink or mirror the element.
- Translate — Shift the element horizontally and vertically without affecting document flow.
- Copy CSS — Click "Copy CSS" to get the ready-to-use
transformdeclaration.
What Is CSS transform?
CSS transform lets you rotate, scale, skew and translate elements in 2D or 3D space. Unlike positioning, transforms do not affect the layout of surrounding elements.
Transforms are GPU-composited, making them ideal for animations and transitions. Combining multiple functions in one transform property applies them in order from right to left.
Common Use Cases
Tips & Best Practices
By default, transforms originate from the element's center. Use transform-origin to rotate around a corner or custom point.
Animating transform is far cheaper than animating top/left. It avoids layout recalculation and stays on the compositor thread.
rotate(45deg) scale(2) produces a different result than scale(2) rotate(45deg). The rightmost function applies first.
Add perspective to the parent and use rotateX / rotateY for realistic 3D card flips and cube effects.
Frequently Asked Questions
Does transform affect page layout?
No. Transformed elements occupy their original space in the document flow. Other elements do not reflow when you apply a transform.
Can I animate CSS transforms?
Yes. Use transition: transform 0.3s ease; for hover effects, or @keyframes for looping animations. Transforms are among the best-performing CSS properties to animate.
What is the difference between translate and position?
translate moves an element visually without affecting layout. position: relative with top/left also moves it visually, but can trigger layout recalculations during animation.
How do I flip an element horizontally?
Use transform: scaleX(-1); to mirror horizontally, or scaleY(-1) to flip vertically.