Crop SVG to Content

Trim excess margin from an SVG file by recalculating its viewBox to fit the actual artwork.

Files never leave your device — cropping runs entirely in your browser.

Related tools

How it works

  1. 1

    Choose an SVG file

    Pick an .svg file from your device (up to 5 MB).

  2. 2

    Content bounding box is measured

    The tool finds the tightest box around everything actually drawn, ignoring empty margin.

  3. 3

    Download the cropped file

    Same shapes and paths, just a tighter viewBox — nothing is rasterized.

FAQ

Does this change the shapes/paths inside the SVG?
No — only the viewBox (and width/height, if they were a fixed pixel size) is recalculated. Every path, shape and style is left exactly as-is.
What counts as "excess" to crop?
Any empty margin around the visible artwork — the tool computes the bounding box of everything actually rendered and sets the viewBox to match, with optional extra padding.
Will this work on any SVG file?
Most hand-authored or exported SVGs, yes. An SVG with no visible content (empty file, or everything inside a hidden/`display:none` element) has nothing to crop to and will show an error.
Does this tool upload my file anywhere?
No — the SVG is parsed and measured entirely in your browser (in a sandboxed, script-disabled frame); the file never leaves your device.

Tool4U.net — every tool runs in your browser. No file ever leaves your device unless the tool says so.