CSS can flip any element horizontally or vertically using negative scale values.
Loading Transform Gen…
Horizontal flip with scaleX(-1), vertical flip with scaleY(-1)
Combine both for full 180-degree mirror
Works on images, icons, SVGs, and any HTML element
RTL direction-aware flip pattern with [dir="rtl"] selector
Drop the Transform Gen into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.
Embed code
<iframe
src="https://www.fixtools.io/css-tool/transform-gen?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="Transform Gen by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
Negative scale values mirror the element across an axis. scaleX(-1) multiplies the X coordinates of all points by -1, reflecting them across the vertical axis at the transform origin. The element appears as its own mirror image. This does not change the element's layout dimensions or position; it only affects visual rendering. scaleY(-1) reflects points across the horizontal axis, producing an upside-down version of the element. Both transforms run on the GPU compositor at the same performance level as any other scale transform. The element's text, if present, will appear mirrored, so negative scale flips are typically used on images, icons, and decorative elements rather than text containers.
RTL (right-to-left) layout support is one of the most practical uses of CSS flip. Directional icons such as arrows, chevrons, navigation indicators, and speech bubbles need to point in the opposite direction for RTL languages. The standard approach is to keep a single SVG or image asset and apply transform: scaleX(-1) inside a [dir="rtl"] selector. This avoids maintaining separate LTR and RTL asset sets and ensures any icon updates propagate to both directions automatically. The transform is applied to the icon element or its parent, and the browser handles the mirror at render time with no additional network requests.
Animated flips use the same scaleX(-1) technique in a transition or @keyframes context. A card that flips on click transitions from scaleX(1) to scaleX(-1) over 400ms. Unlike rotateY(180deg) which produces a 3D flip with perspective depth, an scaleX(-1) flip is a 2D mirror that flips instantly through the zero point without perspective foreshortening. For a more realistic 3D flip, combine scaleX(-1) with rotateY, or use a full 3D card flip setup with preserve-3d and backface-visibility. For a quick 2D icon flip toggle such as expand and collapse indicators, the scaleX(-1) transition is simpler and sufficient.
Flip transforms have a known cross-engine quirk: when an element animates from scaleX(1) to scaleX(-1) the browser must pass through scaleX(0), which collapses the element to a single line of pixels at the midpoint. Chrome and Edge render this midpoint as a clean vertical line, Firefox produces a similar result, and Safari occasionally shows a brief flicker on retina displays as the rasterizer drops below subpixel resolution. The visual effect is so brief that most users will not notice, but on slow animations longer than 600ms the collapse becomes visible. To eliminate the collapse entirely, animate through rotateY(0deg) to rotateY(180deg) inside a perspective context instead, which produces a proper 3D flip with depth and no zero-width midpoint frame.
Select horizontal flip, vertical flip, or both from the toggle. The preview element updates immediately. For animated flips, enable the transition option to add a transition: transform declaration. Copy the CSS output for use in your stylesheet.
Step-by-step guide to css flip image:
Choose the flip direction
Select horizontal flip (scaleX(-1)), vertical flip (scaleY(-1)), or both. The preview updates immediately to show the mirrored result.
Set transform-origin if needed
For most flip effects, the default center origin is correct. If the flip should hinge from an edge, adjust the origin using the origin grid.
Enable transition for animated flips
Toggle the transition option to add transition: transform 400ms ease to the output. Adjust the duration value to match your design timing.
Copy the CSS
Click Copy Code to export the transform declaration. For RTL support, the output optionally includes a [dir="rtl"] selector wrapper.
Common situations where this approach makes a real difference:
RTL navigation arrow icon
A multi-language application uses a right-pointing chevron SVG icon in breadcrumb navigation. For Arabic and Hebrew pages, the chevron should point left. The developer adds a single CSS rule: [dir="rtl"] .nav-icon { transform: scaleX(-1); }. Setting dir="rtl" on the html element for RTL locale pages automatically applies the flip to every navigation icon on the page. No separate SVG assets are needed.
Image reflection effect
A product showcase page features a device mockup with a reflection below it to suggest a glossy surface. The developer duplicates the mockup image in an aria-hidden container, applies scaleY(-1), and overlays a CSS gradient from transparent to white using a ::after pseudo-element on the container. The CSS-only reflection matches the mockup position precisely and scales correctly at all viewport widths without JavaScript or image editing.
Expand/collapse indicator flip
An accordion component uses a down-arrow icon that flips to an up-arrow when the panel is open. The base state is scaleY(1). The open state class applies scaleY(-1). transition: transform 250ms ease on the base icon element animates the flip. The generator confirms scaleY(-1) produces the correct upward-pointing arrow and validates the transition timing before the CSS is committed to the component.
Mirrored decorative element pair
A landing page hero has two decorative leaf SVG elements flanking the headline, one on each side as a mirror pair. Rather than maintaining two separate SVG assets, the developer uses a single leaf SVG and applies transform: scaleX(-1) to the right-side instance. The CSS is generated in seconds and the layout uses flexbox with the same element class, keeping the template simple and the asset library small.
Get better results with these expert suggestions:
scaleX(-1) is identical to rotateY(180deg) in 2D but cheaper in 3D contexts
In a flat 2D context without perspective, scaleX(-1) and rotateY(180deg) produce the same visual result: a horizontally mirrored element. However, in a 3D context with preserve-3d, rotateY(180deg) actually rotates the element in 3D space, showing the back face. scaleX(-1) mirrors without any Z-depth change. Choose based on whether the intent is a flat mirror or a 3D rotation.
Use logical CSS properties instead of flip for text direction
For layout mirroring in RTL, CSS logical properties like margin-inline-start, padding-block-end, and border-inline-start are the modern approach. They automatically adapt to the writing direction. Reserve scaleX(-1) for visual assets like icons and images that cannot be expressed as logical properties. Mixing both approaches keeps each concern in the right layer of the system.
Animated flip needs transition on the base element, not the state class
For a toggle flip animation where JavaScript adds a flipped class with scaleX(-1), the transition: transform declaration must be on the base element, not on the .flipped class. The browser applies the transition when the value changes from the base state to the flipped state. If transition is only on .flipped, the forward flip animates but the reverse flip when the class is removed snaps instantly.
Vertical flip with scaleY(-1) is useful for reflection effects
A water reflection effect places a copy of an element below the original with scaleY(-1) applied. Add a linear gradient overlay using a ::after pseudo-element fading from transparent to the background color to fade out the bottom of the reflection. This produces a simple but effective reflection without image editing. The copied element should be aria-hidden="true" to keep it invisible to screen readers.
Use [dir="rtl"] for automatic icon flipping in RTL layouts
Placing transform: scaleX(-1) inside a [dir="rtl"] selector applied to the html element automatically mirrors all elements with the flip class across the entire page. This is more maintainable than manually flipping individual icons. Set dir="rtl" on the html tag when serving RTL language pages and let the CSS rule handle all icon mirroring.
Apply flip to the img element, not the figure container
Applying scaleX(-1) to a figure or container element also flips any text captions inside it. Target the img or SVG element directly to flip only the visual asset. If the flip must be on a container for layout reasons, add an opposite scaleX(-1) to the text children to cancel the inherited flip.
Combine flip with CSS filter for stylized effects
Combining scaleX(-1) with CSS filter properties like grayscale(100%) or hue-rotate(180deg) creates stylized image effects without Photoshop. Apply both transform and filter to the same img element. Both properties run on the compositor and compose together without performance overhead.
More use-case guides for the same tool:
Other tools you might find useful:
Open the full Transform Gen — free, no account needed, works on any device.
Open Transform Gen →Free · No account needed · Works on any device