CSS Transform Generator
Combine translate, scale, rotate and skew with sliders, watch a live preview and copy the transform rule, written in a fixed order that keeps moves predictable.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the CSS Transform Generator?
The CSS Transform Generator writes a transform property from seven sliders: Translate X and Y (-200 to 200px), Scale X and Y (0 to 3 in steps of 0.1), Rotate (-360 to 360 degrees) and Skew X and Y (-60 to 60 degrees). A square in the Live Preview moves as you drag, and the CSS Code box shows the rule.
Only functions you have changed are written out, always in the order translate, scale, rotate, skew. At the defaults the output is transform: none;. Copy CSS puts the declaration on your clipboard and Download saves transform.css with a .transform class.
It covers the 2D transform functions. 3D functions such as perspective, rotateX and translateZ, and the newer individual translate, rotate and scale properties, are not generated. Everything runs locally in your browser.
- Translate, scale, rotate and skew on both axes
- Only changed functions are written, in a fixed, predictable order
- Live preview square
- Copy CSS or download transform.css
- No sign-up, runs in your browser
Updated
How to use the CSS Transform Generator
- Drag Translate X and Translate Y to move the preview square.
- Drag Scale X and Scale Y to stretch or shrink it. 1 means original size.
- Use Rotate to spin it and Skew X or Skew Y to slant it.
- Read the rule in the CSS Code box, then click Copy CSS or Download. The reset button returns everything to transform: none.
Worked examples
Move, enlarge and tilt
Input
Translate X 50, Scale X and Y 1.5, Rotate 45
Output
transform: translate(50px, 0px) scale(1.5, 1.5) rotate(45deg);
Unchanged functions such as skew are left out. Because translate comes first, the square moves exactly 50px to the right even though it is also scaled and rotated.
Rotating is not mirroring
Input
Rotate 180, everything else at default
Output
transform: rotate(180deg);
A 180 degree turn puts an arrow icon upside down as well as pointing left. To mirror it for right-to-left layouts you need scale(-1, 1), and the Scale sliders stop at 0, so edit the copied rule by hand.
Background and insight
The order of functions in a transform list changes the result. The browser multiplies the functions left to right into one matrix, which means the rightmost function is applied to the element first. transform: rotate(45deg) translate(100px, 0) moves the element 100px along its own rotated x-axis, so it ends up diagonally down and to the right. transform: translate(100px, 0) rotate(45deg) moves it 100px straight right and then spins it in place.
This tool always writes translate first, so moves happen in the page's coordinates and are not stretched by scale or tilted by rotation. That matches what most people expect from sliders labelled X and Y. If you want the other behaviour, reorder the functions in the copied CSS.
Transforms do not affect layout. The element keeps its original box in the flow and neighbours do not move, which is why transforms are the cheap way to animate: the browser can usually composite them on the GPU without recalculating layout. All rotation and scaling happen around transform-origin, which defaults to the centre (50% 50%). Change it to top left to pivot from a corner.
Common use cases
Hover and focus effects
Find a scale and translate that make a card lift slightly on hover without shifting layout.
Animation keyframes
Get exact transform values for the start and end of a CSS transition or @keyframes rule.
Decorative tilts
Rotate or skew a badge, ribbon or section divider and copy the exact angle.
Teaching transform order
Show how combined functions render and then experiment with reordering them in your own CSS.
Tips and limitations
- Reordering functions changes the result. rotate then translate moves along the rotated axis; translate then rotate does not.
- Percentages in translate are relative to the element's own size. translate(-50%, -50%) is the classic way to centre an absolutely positioned element.
- Scale 0 makes the element invisible but it still takes up its layout space. Use visibility or display when you want it gone from the layout or the accessibility tree.
- Skew distorts text and can make it hard to read. Keep skew angles small on anything with words in it.
- If another rule also sets transform, the later one replaces the whole list. Combine all functions in one declaration or use the separate translate, rotate and scale properties.
Sources and further reading
- CSS Transforms Module Level 1, W3C. How a transform list is multiplied into one matrix, and transform-origin
- CSS Transforms Module Level 2, W3C. The individual translate, rotate and scale properties
- transform CSS property, MDN Web Docs. Transform functions and why they do not affect layout
Frequently asked questions
Does the order of CSS transform functions matter?
Yes. Functions are combined into one matrix, so the rightmost one is applied to the element first. rotate(45deg) translate(100px) moves the element along its rotated axis, while translate(100px) rotate(45deg) moves it straight right and then rotates it. This tool always writes translate first.
Why does my transformed element overlap its neighbours?
Transforms are applied after layout, so the element keeps its original space and other elements do not move out of the way. That is by design and is what makes transforms cheap to animate. If you need neighbours to react, change width, margin or position instead.
How do I rotate an element around a corner instead of the centre?
Set transform-origin. The default is 50% 50%, the centre. transform-origin: top left; pivots rotation and scaling around the top-left corner. The generator leaves the origin at its default, so add the property yourself next to the copied transform.
Can I generate 3D transforms like rotateY or perspective here?
No, the tool covers the 2D functions translate, scale, rotate and skew. For 3D effects add perspective on the parent or perspective() at the start of the list, then use rotateX, rotateY or translateZ in the copied rule.
What is the difference between transform: rotate() and the rotate property?
The individual rotate, scale and translate properties are newer and can be set or animated independently, so a hover rule can change scale without wiping out a rotation. They are always applied in the fixed order translate, rotate, scale. The transform property applies functions in the order you list them.
Is scale(1.5, 1.5) the same as scale(1.5)?
Yes. With one value, scale uses it for both axes. The generator always writes two values so that it is clear which axis is which when you edit the rule later.
Is there an in-depth guide to the CSS Transform Generator?
Yes. “CSS Gradients, Box Shadows and Transforms: The Parts People Get Wrong” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.