SVG Crop, Flip and Rotate in the Browser

Trim the empty margins off an SVG, flip it on either axis, and rotate it by 90, 180, 270 or any angle you type. The paths are never rewritten — only the viewBox and the transform change, so strokes, gradients and ids survive intact.

No uploadLive previewAny angleExact viewBox

1. Source SVG

empty
Drop an .svg file here, or

2. Crop, flip and rotate

changes apply live

flip none · rotation 0° · trim on, padding 8

3. Result

Source —
Result —
viewBox — size —

Invisible nodes — fill="none" with stroke="none", display:none, opacity 0 — are ignored when the content box is measured, so an empty background rectangle will not defeat the crop.

Paste an SVG or load the sample to start.

Cropping an SVG means rewriting the viewBox, not deleting geometry — set the box to the content bounding box and the empty margins stop taking up space while every path, gradient and id stays in the file.

What this tool does to the file

Three operations, all of them expressed as numbers in the root element. Nothing walks the path data, so a crop-and-flip of a 400 KB illustration returns exactly 400 KB of untouched paths and a different viewBox.

Why the viewBox is the right place to crop

A design tool will happily delete the artboard margin for you, but it does so by rewriting every coordinate, which is how icons come back with transform="translate(...)" stacked three deep and strokes that no longer line up with their shapes. The viewBox is a window: change the window and the drawing is untouched. That matters when the file still has to open in Illustrator, Inkscape, a laser cutter and a CMS field that strips transforms it does not understand.

The same reasoning applies to rotation. Rotating the coordinates of a path is lossy for curves in a way that a matrix is not — a 90° rotation as a matrix is exact, and the arcs, dash offsets and gradient vectors follow it without rounding.

Running order: trim, then flip, then rotate

The order is fixed on this page because it produces the most predictable result: measure the content, apply the orientation change, then measure again for the final window. Two consequences are worth knowing.

First, padding is applied after the transform, so a padding of 8 stays 8 user units on screen whichever way the artwork faces. Second, a rotation of 45° grows the box: the axis-aligned bounding box of a rotated square is bigger than the square, exactly as it should be, and the reported size reflects that rather than clipping the corners. If the numbers look larger than you expected at odd angles, that is the corner geometry, not a bug.

When trimming is the actual fix

Empty margins are the most common reason a logo looks tiny inside its frame on a website, on a sticker proof, or in a cutting program that sizes by the bounding box. A wordmark exported from Figma often carries 40% empty canvas, so the same width="100%" rule renders the visible mark at 60% of the space you gave it. Trim the box and the artwork fills the frame with no CSS changes.

Trim also helps before tracing or before handing the file to a machine that centres by the page: a screenshot-derived SVG with slack on one side is the usual cause of “the cut is off”. Once the box hugs the content, the SVG resize tool can set a physical size, the SVG compressor can drop the metadata, and the SVG code editor is there if you would rather type the four numbers by hand.

Flip is not mirror-the-file

Flipping with a negative scale is what every renderer does, and it is why text inside a flipped group comes out mirrored while an icon does not change a pixel. If the artwork contains <text>, flip it back after the export or convert the text to paths first — the SVG validator reports live text as a warning for the same reason.

Privacy

The file is read with FileReader and transformed with the browser DOM. Both run inside the tab: no upload endpoint, no request per edit, no copy of the artwork kept between visits. The tool keeps working with the network switched off.

Trimming an SVG to its content bounding box, then flipping and rotating it into four results
Trim to the content box, add padding, then flip or rotate — the viewBox follows every step · swipe to see it all

Frequently asked questions

Does cropping an SVG delete anything?

No. Cropping only rewrites the viewBox and the width/height attributes so the empty margins fall outside the visible area. Every path, gradient and id stays in the file, so restoring the old viewBox restores the original framing.

Why does rotating my SVG cut off part of the artwork?

Because the rotation happened around the origin, or the viewBox was left unchanged. This tool rotates about the centre of the content bounding box and then recomputes the viewBox from the rotated corners, so nothing clips at 90, 180 or any other angle.

Is the SVG uploaded to a server?

No. The file is read with FileReader and transformed with the browser DOM. Nothing is sent anywhere, and the tool keeps working offline once loaded.

Does flipping break stroke widths or gradients?

No. The flip is scale(-1,1) on a wrapping group, so stroke widths, dash patterns and gradient geometry are untouched — only the orientation changes. Live <text> does mirror, as it would in any editor.

Can I crop a specific rectangle instead of the content box?

This page trims to the content bounding box with adjustable padding. For a precise rectangle, set the padding negative or copy the viewBox value printed under the preview and edit it in any text editor — it is written out exactly.

Related SVG workflows

More free SVG tools