Mirror CSS from Left-to-Right to Right-to-Left
Swap the left and right sides of a stylesheet for a right-to-left build, with a list of every declaration that changed.
Use this tool in your browser without installing software.
About this tool
Paste a stylesheet and the tool swaps the left and right sides of its declarations: margin-left with padding-right, the left and right properties, borders, border-radius corners, and the left/right keywords in text-align, float, clear and background-position. Four-value shorthands such as margin: 0 8px 0 16px swap their second and fourth value, while two and three values stay as they are because they are already symmetric. Selectors, strings, custom properties and transform values are deliberately left alone: a class named left-column or a translateX() animation is not a layout side. Below the box, every changed declaration is listed with its old and new value so you can review the result before copying.
How to use it
- 1
Paste your CSS into the box; a whole stylesheet or just a few declarations both work.
- 2
Check the mirroring options: edges, corners, alignment, and the shadow offset if you need it.
- 3
Review the list of changes and copy the result; the original text is never modified.
If the answer looks wrong
- The output matches the input.
The mirroring options may be off, or the CSS may have no left or right side. Try the sample to see what the tool changes.
- Part of the code was not changed.
Selectors, strings, custom properties (--x) and transform values are left alone on purpose. If a property is missing from the list, adjust it yourself in the output.
- It says the braces do not close.
The code is incomplete or part of it was not pasted. Close the open blocks so the tool can find where each declaration ends.
Frequently asked questions
Why are two and three value shorthands left alone?
In margin and padding the second value sets both the left and right side, and in the three-value form the third value covers both sides too. Mirroring them would change nothing, so only the four-value form is swapped.
Why does a three-value border-radius become four values?
With three values the bottom-left corner is copied from the top-right one. After mirroring those two are no longer equal, so the output needs four values to keep the same mirrored shape.
Why is transform not mirrored?
A translateX() may be part of the layout or just an animation. Since the tool cannot tell them apart, it leaves transform values alone; if you need one mirrored, flip the sign of its horizontal number yourself.
Why is the shadow not mirrored by default?
A shadow offset is often a design choice rather than part of the layout. Turn the shadow option on and the horizontal number of each layer is flipped while the rest of the values stay the same.
Is the CSS sent to a server?
No. Every change happens in your browser and the stylesheet never leaves your device.