🎨 CSS & Design

CSS Transform Generator

Move, rotate, scale, skew and tilt in 3D — then copy the transform.

  • 9transform controls
  • 9origin presets
  • 0–2000pxperspective
  • 1line of CSS
CSS

    

How to use the CSS Transform Generator

  1. 1

    Move and rotate

    Drag translateX/Y (±150px) and rotate (±180°).

  2. 2

    Scale and skew

    Set scaleX/Y from 0 to 3 (locked together by default) and skewX/Y up to ±60°.

  3. 3

    Add 3D tilt

    Use rotateX and rotateY; perspective (default 600px) adds depth when either is non-zero.

  4. 4

    Copy the CSS

    The output lists only the functions you changed, plus transform-origin if it isn’t centre.

Features

Minimal output

Unchanged functions are left out, and translate collapses to translateX or translateY when only one axis moves.

Scale lock

Keeps scaleX and scaleY equal for uniform resizing; untick for stretching.

Origin presets

Nine transform-origin positions from top left to bottom right.

Automatic perspective

perspective() is added only when a 3D rotation is in use.

Original outline

A dashed outline marks where the element still sits in the layout.

One-click reset

Restores every control to its neutral value.

Who uses it — and for what

Hover effects

Tune a lift, tilt or grow effect before adding a transition.

Card flips

Find the right rotateY and perspective for a 3D card.

Badges and ribbons

Rotate and position corner labels precisely.

Learning CSS

See how each function changes the box in real time.

Transform functions

transform changes how an element is drawn without affecting the layout around it. translate moves it, rotate turns it around the transform-origin (the centre by default), scale resizes it (1 = original) and skew slants it. Functions are applied right to left, so rotate(45deg) translateX(100px) is different from the reverse order. The dashed outline in the preview shows the element’s original position, which keeps its space in the layout.

3D and performance

rotateX and rotateY tilt the element in 3D; perspective() sets how far the viewer is from it — smaller values give a stronger, more dramatic depth. Transforms (together with opacity) are the cheapest properties to animate because the browser can move layers on the GPU without recalculating layout, so prefer transform: translateY() over changing top or margin for hover lifts and slide-ins.

Everything updates live as you drag — copy the code when it looks right. Nothing is uploaded and there is no sign-up.

Thinking in coordinate systems

The easiest way to predict a transform list is to imagine each function moving a sheet of graph paper the element is drawn on. Each function then works on the paper as the previous function left it.

  • rotate(90deg) translateX(100px): the paper turns 90° clockwise first, so its x-axis now points down the screen, and the element ends up 100px below where it started.
  • translateX(100px) rotate(90deg): the element moves 100px right, then spins on the spot.

Rotation, scale and skew all pivot around transform-origin. With the default centre, a 100 × 100 box rotated 45° keeps its centre still but its corners now reach about 70.7px from the centre, so the visual footprint is roughly 141 × 141px. Content around it does not move to make room — the element can overlap neighbours, which is why transformed elements sometimes need extra margin or a higher z-index.

Two side-effects of any transform other than none catch people out: the element becomes a containing block for position: fixed children (so a “fixed” modal inside it scrolls with it), and it creates a new stacking context, which can change how z-index behaves.

Individual transform properties and when to use them

Modern browsers also support separate translate, rotate and scale properties alongside transform:

.card { translate: 0 -6px; scale: 1.03; }

They are handy when different rules control different parts — for example, a hover rule that only scales while an animation only rotates — because setting one doesn’t wipe out the others the way a second transform declaration would. They are always applied in a fixed order (translate, then rotate, then scale), before anything in the transform property.

The generator outputs a single transform declaration because it is the most widely understood form and the one you need for skew and perspective. If you prefer the individual properties, copy the values across; just remember the fixed order may differ from the order you see in the generated list.

For smooth animation, combine transforms with will-change: transform sparingly — only on elements that are about to animate — since every promoted layer uses memory. For flip cards, add backface-visibility: hidden to both faces so the back of the front face doesn’t show through.

Worked examples

Typical hover lift

translateY −6px, scale 1.05:

transform: translateY(-6px) scale(1.05);

Pair it with transition: transform 0.2s on the base state. Because the translate comes first in the list, the 6px move is not affected by the scaling.

3D card tilt

rotateY 25°, perspective 600px:

transform: perspective(600px) rotateY(25deg);

Drop perspective to 300px and the same 25° looks much more dramatic, because the virtual viewer is closer. Set perspective to 0 and the rotation flattens into a simple horizontal squash.

Order of the generated functions

Moving every slider produces functions in a fixed order: perspective(), translate, rotate(), rotateX(), rotateY(), scale, skew. For example translate 40px/20px, rotate 15°, scale 1.2, skewX 10°:

transform: translate(40px, 20px) rotate(15deg) scale(1.2) skewX(10deg);

Putting translate first means the movement happens in the page’s normal directions; if you edit the code to put rotate first, the 40px move would follow the rotated axis instead.

Pro tips

  • Scale 0 shrinks the element to nothing visually, but its original space in the layout stays reserved; use display: none if the space should collapse too.
  • Negative scale values are not available on the sliders, but scaleX(-1) in your own CSS mirrors an element horizontally.
  • Skew distorts text noticeably beyond about 15°; keep larger skews for decorative shapes.

Glossary

transform-origin
The pivot point for rotate, scale and skew.
Perspective
The distance between the viewer and the z = 0 plane; smaller values exaggerate 3D effects.
Stacking context
A group of elements layered together for z-index purposes, created by transforms among other properties.

Frequently asked questions

Does transform affect surrounding elements?

No — other elements still see the original size and position.

Why does the order of functions matter?

Each function transforms the coordinate system for the next, so rotating then moving goes a different way to moving then rotating.

What is transform-origin?

The pivot point for rotate, scale and skew — the centre unless you change it.

What is the difference between perspective() and the perspective property?

perspective() inside transform applies to that one element. The perspective property goes on a parent and gives all its 3D children a shared vanishing point.

Why did my fixed-position popup start scrolling with the page?

An ancestor has a transform. Any transform other than none makes that ancestor the containing block for fixed-position descendants.

Can I animate between two transforms?

Yes. Browsers interpolate transforms smoothly, especially when both states list the same functions in the same order.

Found it useful? Share the CSS Transform Generator:

Last updated 2026-11-28 · Built by Vinayak Agarwal · Part of CSS & Design (37 tools)