What translate3d() does
translate3d() is a CSS transform function that displaces an element along the X, Y and Z axes at once. It is the three-dimensional companion to translate(), applied through the transform property, and is defined in the CSS Transforms Module Level 2 specification. Reach for it when an element needs to move with a sense of depth.
.card {
transform: translate3d(40px, -20px, 100px);
}
Syntax and arguments
<translate3d()> = translate3d(<length-percentage>, <length-percentage>, <length> )
Put plainly, the function slides the element horizontally, vertically, and to a given depth in 3D space:
transform: translate3d(tx, ty, tz);
/* px values */
transform: translate3d(50px, -30px, 200px);
/* percentages for x and y (relative to the element itself) */
transform: translate3d(50%, -50%, 0);
/* mix of units */
transform: translate3d(2rem, 1em, 100px);
/* no movement at all */
transform: translate3d(0, 0, 0);
tx— horizontal displacement. Positive values move right, negative values move left. Accepts<length>or<percentage>, where percentages resolve against the element's width.ty— vertical displacement. Positive values move down, negative values move up. Accepts<length>or<percentage>, resolved against the element's height.tz— depth. Positive values bring the element toward the viewer, negative values push it away. Only<length>is valid here; a percentage has no depth dimension to be calculated from.
How the Z axis behaves
The X and Y axes map to the horizontal and vertical directions on screen. The Z axis runs straight toward and away from the viewer, so a positive value such as 50px appears to move the element forward and a negative value such as -50px sends it backward.
On its own, a Z translation produces no visible effect. It needs the perspective property on the element's parent, which acts as the container the element is transformed inside:
/* This alone won't work */
.element {
transform: translate3d(0, 0, 100px);
}
/* Instead... */
/* Add perspective to a parent to create depth */
.parent {
perspective: 600px;
.element {
transform: translate3d(0, 0, 100px); /* Visibly closer */
}
}
The perspective value can be thought of as the distance between the viewer's eye and the screen. 200px gives an intense, fisheye-like effect; 1200px gives subtle, refined depth. A range of 400px–900px usually works best, though the right value often requires experimentation.
When to use it, and what it costs
For movement along one or two axes, shorthand functions exist:
/* These are all equivalent */
transform: translate3d(50px, 0, 0);
transform: translateX(50px);
/* These are all equivalent */
transform: translate3d(0, 30px, 0);
transform: translateY(30px);
/* These are all equivalent */
transform: translate3d(0, 0, 100px);
transform: translateZ(100px);
The three-axis form is frequently chosen even when one or two arguments are 0, because it prompts the browser to composite the element on the GPU — when available, that helps animation performance. The clearest real use is animating depth, as in parallax effects and card flips. Three cards staggered at different Z positions illustrate the idea:
.parent {
perspective: 800px;
.card-front {
transform: translate3d(0, 0, 80px);
}
.card-middle {
transform: translate3d(0, 0, 0px);
}
.card-back {
transform: translate3d(0, 0, -100px);
}
}
The pattern translate3d(0, 0, 0) looks like a no-op, and it appears in plenty of older CSS codebases, but it promotes the element to its own composite layer for smoother animation:
.animated-element {
transform: translate3d(0, 0, 0);
}
That trick is rarely necessary now — modern browsers handle this well, and will-change: transform often suffices. Overusing translate3d() also wastes memory, so it is better reserved for fixing a transition that actually visibly janks.
Chaining with other 3D transforms
The function is most effective combined with rotate3d() or scale3d(). Transform functions render in order from right to left, so the order of functions in the transform shorthand changes the result:
/* Rotates first, then translates in the rotated space */
transform: translate3d(0, 0, 100px) rotateY(45deg);
/* Translates first, then rotates around the original origin */
transform: rotateY(45deg) translate3d(0, 0, 100px);
These two declarations yield different outcomes — turning and then stepping forward is not the same as stepping forward and then turning.
Specification and support
The function is defined in CSS Transforms Module Level 2, currently an Editor's Draft, meaning details may change before it reaches Candidate Recommendation. Support is complete across all modern browsers.



