Developer

CSS Transform Playground

Combine translate, rotate, scale, and skew values with a live preview box and CSS export.

Loading interactive tool…

Embed this tool on your site

About this tool

CSS transforms — translate, rotate, scale and skew — are the foundation of hover lift effects, tilted badges, skewed hero backgrounds, and GPU-accelerated animations. The CSS Transform Playground gives you six number inputs: Translate X and Translate Y in pixels, Rotate in degrees, Scale as a ratio (minimum 0.1), and Skew X and Skew Y in degrees. A gradient sample box in the preview applies the combined transform as you type, and Reset returns every value to neutral. The output is a single transform declaration that always lists the functions in the same order — translate, rotate, scale, skew — including any left at their neutral values, so you can delete what you do not need. Because transform functions apply in written order, rotating before translating gives a different result; the playground shows the result of this fixed order. 3D functions, perspective and transform-origin are not included.

Why use it

  • Four 2D Functions: translate, rotate, scale and skew each have number inputs — Translate X/Y in px, Rotate and Skew X/Y in degrees, Scale as a ratio — so you can combine them without writing test code.

  • Fixed Order: The output always lists translate, then rotate, then scale, then skew. Transform functions apply in written order, so the preview shows exactly what that sequence produces.

  • Live Box: A 72px gradient box in the preview applies the transform on every keystroke, so you can see offset, rotation and distortion together.

  • Reset Button: One click returns all six inputs to their neutral values (0, and 1 for scale), giving you a clean baseline without reloading the page.

  • Copy CSS: The output is a single transform declaration including every function, even ones left at neutral values, ready to paste into a :hover rule or @keyframes stop.

How to use

  1. Enter Translate X and Translate Y in pixels
  2. Enter Rotate in degrees
  3. Set Scale (minimum 0.1; 1 is the original size)
  4. Enter Skew X and Skew Y in degrees
  5. Watch the sample box update, and click Reset to return all values to 0 and scale to 1
  6. Click Copy CSS to grab the transform declaration

When it helps

  • When building a hover card lift effect with translateY and scale that should feel natural
  • When nudging a badge or icon with a small rotation and offset
  • When designing a skewed hero section background that tilts without breaking text readability
  • When learning what each 2D transform function does before combining them
  • When testing scale values below and above 1 for a press or hover effect
  • When producing a starting transform value to paste into a :hover rule or @keyframes stop

Examples

Lifted card on hover

Input
Translate Y: -4, Scale: 1.02 (others neutral)
Expected result
transform: translate(0px, -4px) rotate(0deg) scale(1.02) skew(0deg, 0deg);

Tilted polaroid

Input
Rotate: -3, Skew X: 2 (others neutral)
Expected result
transform: translate(0px, 0px) rotate(-3deg) scale(1) skew(2deg, 0deg);

Offset and enlarged

Input
Translate X: 20, Rotate: 45, Scale: 1.5
Expected result
transform: translate(20px, 0px) rotate(45deg) scale(1.5) skew(0deg, 0deg);

Tips

  • Write rotate before translate when you want movement along a rotated axis; write translate before rotate when you want rotation around a fixed offset point — the difference is significant
  • Use translate3d(0, 0, 0) or translateZ(0) as a no-op transform to force GPU layer promotion when other non-transform properties change on the element
  • Set perspective on the parent element rather than in the child's transform chain when multiple children need consistent shared depth
  • transform-origin defaults to center — move it to an edge (0% 50% for left hinge, 100% 50% for right hinge) before applying rotate for door and page-flip animations
  • Combine all transform functions in a single transform declaration — declaring transform twice overrides the first, not stacks with it

Frequently Asked Questions

Why does transform order change the result?
Each transform function modifies the local coordinate system before the next function applies. Rotating first then translating moves the element along the rotated axes, not the original axes. Translating first then rotating pivots around the new position. The mathematical operations are not commutative.
What is the difference between translate and margin offset?
translate moves the visual rendering of the element without affecting layout. Other elements do not shift around it and the element retains its original layout space. Margin changes layout and shifts surrounding elements. translate is preferred for animations since it avoids layout recalculation.
How does perspective work in CSS 3D?
perspective() defines the viewer's distance from the z=0 plane. Closer perspective values (200–400px) produce dramatic foreshortening; larger values (800–1200px) produce subtle depth. Applied to a transform on the element itself, or as a perspective property on the parent container.
Why is transform GPU-accelerated and top/left is not?
transform and opacity changes can be composited on the GPU without triggering layout or paint of surrounding elements. Changing top, left, or margin affects the layout flow and requires the browser to recalculate positions of all affected elements on the main thread before painting.
What does transform-origin actually pivot around?
transform-origin sets the point around which rotate, scale, and skew transforms pivot. The default is center center (50% 50%). Setting it to top left (0% 0%) makes rotations pivot from the top-left corner rather than the element's center, enabling hinge and fold animations.
Can I animate transform smoothly with transitions?
Yes. transform is fully interpolatable via transition or @keyframes. All values in the transform shorthand interpolate simultaneously, so you can transition between two different multi-function transform values. Ensure both states have the same function types to avoid interpolation gaps.
How is matrix() different from individual functions?
matrix() and matrix3d() express the combined transformation as a single mathematical matrix. Individual functions like rotate() and scale() are syntactic sugar that the browser converts to matrices internally. matrix() is compact but unreadable; individual functions are self-documenting and easier to modify.
Why does my 3D rotation look flat?
Without a perspective value, CSS treats 3D transforms as parallel projections where depth has no visual effect. Add perspective(600px) to the transform chain or set perspective: 600px on the parent element. Without perspective, rotateY(45deg) renders as a horizontal scale transformation.

Explore the category

Glossary

Translate
A transform function that moves an element along the X, Y, or Z axis without affecting its layout position or surrounding elements. Available as translate(), translateX(), translateY(), translateZ(), and translate3d().
Rotate
A transform function that spins an element around a point defined by transform-origin. rotate() works in 2D; rotateX(), rotateY(), and rotateZ() rotate around the respective 3D axes.
Scale
A transform function that enlarges or shrinks an element proportionally or on individual axes. scale(1.2) enlarges by 20%; scaleX(0.5) squishes to half width without affecting height.
Skew
A transform function that distorts an element along the X or Y axis, tilting it like a parallelogram. Useful for slanted backgrounds and angular design elements.
Perspective
A CSS transform function or property that establishes the viewer distance for 3D rendering. Lower values create dramatic depth foreshortening; higher values produce subtle depth.
Transform Origin
The fixed point around which transform functions pivot. Defaults to the element's center; changing it to a corner or edge enables hinge, fold, and corner-zoom animations.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities