CSS Transform Generator

Free toolNo sign-up
Surface:
CARD
Aa 123
Drag any slider — the card transforms around the chosen origin.
Functions3
Origin50% 50%

About this generator

Stack 2D and 3D CSS transforms visually — translate (X/Y/Z), rotate (X/Y/Z), scale (X/Y with lock), skew (X/Y), perspective, and transform-origin. 14 curated presets — liftHover, pop, shrink, tilt, flipX, flipY, card3D, isometric, shake, skewLeft/Right, spin90/180.

Ghost-reference overlay shows the element’s original position as a dashed outline so you can see EXACTLY where it traveled. Identity values (translate 0, rotate 0°, scale 1×, perspective 1000px) are auto-omitted from the output so the CSS stays intent-clear.

5 framework exports + URL hash permalink. No login, no watermark, no paywall. Free and MIT-licensed.

?

Why use CSS transforms?

GPU-accelerated motion
transform runs on the compositor thread, separate from layout. Animating position via translate is dramatically smoother than animating top / left — and never triggers a reflow.
🎯
No layout side-effects
A transformed element keeps its original space in the document. Hover effects, micro-interactions, and 3D card flips never push siblings around — perfect for grid items and inline UI.
🔮
2D and 3D in one property
Translate, rotate, scale, skew, and full 3D perspective stack into a single transform string. One property, one declaration, infinite combinations — and they all interpolate cleanly.
🎨
Reusable as design tokens
Wrap a hover lift in a custom property — --hover-lift: translateY(-4px) scale(1.02) — and reuse it across cards, buttons, and tiles. One source of truth for your motion language.

How to use this generator

01
Pick a preset
liftHover, pop, tilt, flipX, card3D, isometric, skewLeft — each preset is a starting transform stack you can refine with the sliders below.
02
Drag any slider
Translate (X/Y/Z), rotate (X/Y/Z), scale (X/Y), skew (X/Y), perspective. Identity values (0, 1×, 0°) are auto-omitted from the CSS output to keep the rule clean.
03
Choose a transform-origin
The 3×3 grid sets where the transform pivots. TL rotates a card around its top-left corner; C is the default centre. Origin only appears in the output when changed from 50% 50%.
04
Compare and copy
The dashed ghost shows the original bounds for reference — toggle it off when fine-tuning. Copy CSS to grab the transform plus transform-origin, ready to paste onto any element.

Transform function reference

FunctionGroupNote
translateX(40px)2D · moveSlide horizontally — composited
translate(40px, 8px)2D · moveShorthand for X & Y in one call
rotate(-8deg)2D · rotateSame as rotateZ() in 2D
scale(1.05)2D · scaleEqual X & Y — for hover pops
scale(1.05, 0.95)2D · scaleSquash — X & Y differ
skewX(-12deg)2D · skewSlants horizontally — sheared text
translate3d(0,0,0)3D · perf hintForces GPU layer — common micro-opt
rotateY(45deg)3D · rotateNeeds perspective() to look 3D
rotateX(180deg)3D · rotateVertical flip — card-back reveal
perspective(800px)3D · depthSets the 3D vanishing distance
matrix(a,b,c,d,tx,ty)Low-levelCombined 2D — rarely written by hand
=

Transform patterns

Hover
/* Card lift on hover — pure transform, no layout shift */
.card {
  transition: transform 200ms ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
}
3D flip
/* 3D flip card — requires perspective on the parent */
.flip-scene { perspective: 1000px; }

.flip-card {
  transform-style: preserve-3d;
  transition: transform 0.6s;
}
.flip-card:hover {
  transform: rotateY(180deg);
}
Origin
/* transform-origin controls the pivot point */
.fan-tile-1 {
  transform: rotate(-8deg);
  transform-origin: bottom left;   /* hinges from corner, not centre */
}

.fan-tile-2 {
  transform: rotate(8deg);
  transform-origin: bottom right;
}

Pro tips

01
Order matters — left to right
translate(40px) rotate(45deg) is NOT the same as rotate(45deg) translate(40px). Each function applies in its own coordinate space, so reordering changes the trajectory entirely.
02
Use translate, not top/left
Animating top: 40px triggers layout, paint, and composite. Animating transform: translateY(40px) only composites — 5–10× cheaper, especially on mobile.
03
perspective belongs on the parent (usually)
For multiple 3D children sharing the same scene, set perspective on the wrapper. Use perspective() in transform: only when one element has its own depth.
04
Pair with will-change carefully
will-change: transform promotes the element to its own GPU layer. Useful for elements about to animate — but applying it permanently to many elements eats GPU memory and can hurt performance.
?

Frequently asked questions

01

Why are translate, rotate, scale combined into one transform property?

CSS uses a single transform property that takes a SPACE-SEPARATED CHAIN of functions: transform: translate(10px) rotate(45deg) scale(1.1). The functions apply in order, left-to-right. This generator emits the chain in a consistent order (perspective → translate → rotate → scale → skew) which produces the most intuitive result for most cases. Modern CSS also has SEPARATE properties (translate, rotate, scale) you can set independently — useful when animating one without disturbing others. The export still uses the shorthand chain for compatibility.

02

Why does the chain order matter?

Each transform function operates on the result of the previous one. rotate(45deg) translate(100px) rotates first, then translates 100px in the ROTATED coordinate space (the element moves diagonally). translate(100px) rotate(45deg) translates first, then rotates around the new position. For animations, the order locks in the visual feel. The generator's fixed order (perspective → translate → rotate → scale → skew) is the most common 'natural' order — but in your own CSS you're free to reorder. Common reorder reason: putting rotate BEFORE translate to create orbital motion.

03

Why does perspective only emit when changed?

Identity values — translate(0), rotate(0), scale(1), skew(0), perspective(1000px) — produce no visible change. The generator omits them from the output so the CSS stays short and intent-clear. A 'card3D' preset with only rotateX(12deg), rotateY(-18deg), and perspective(800px) compiles down to those three functions — not a 10-function chain mostly at identity. This makes the output diffable, readable, and faster to debug.

04

What's transform-origin and when should I use it?

transform-origin defines the pivot point for rotations, scales, and skews. Default is 50% 50% (center). Change to 0% 0% (top-left) and a rotation pivots around the top-left corner; change to 50% 100% (bottom-center) and the element rotates/scales like a pendulum. The 9-position picker in this generator covers the standard 3×3 grid. Custom origins (e.g., 30% 70%) require manual edits — let us know if you'd like fine-grain control added.

05

Are CSS transforms GPU-accelerated?

Yes — transform, opacity, and filter run on the GPU compositor thread. Animating them is cheap and stays at 60fps even on lower-end devices. This is why transform-based animations FEEL smoother than animating left/top (which trigger layout) or width/height (which trigger layout + paint). The browser promotes any transformed element to its own compositor layer, costing a small amount of GPU memory but unlocking smooth motion.

06

What about will-change and 3D acceleration tricks?

Most modern browsers already auto-promote transformed elements to GPU layers. will-change: transform is rarely necessary and can HURT perf if applied to too many elements (one compositor layer per element costs GPU memory). The old 'translateZ(0) hack' to force GPU acceleration is obsolete in Chrome 90+, Safari 15+, Firefox 110+. Use will-change only for elements you're ABOUT to animate and remove it afterward. For static transformed elements (a tilted card that doesn't animate), just use transform directly.

07

Is this free for commercial use?

Free, MIT-licensed, zero attribution required, no watermark, no signup. Use on any project — personal, client, enterprise — without permission.

See it used in real designs

Browse hand-coded collections that put this tool to work.

Search CodeFronts

Loading…