width, height and viewBox are different jobs
The viewBox is the drawing's internal coordinate system. width and height are only the size of the picture on the page. A 24-unit icon displayed at 96 pixels is still the same file:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="96" height="96"> <circle cx="12" cy="12" r="10" fill="#111827"/> </svg>
The circle is still centred at (12, 12) with radius 10. It is just drawn four times larger. That is what this tool does: it rewrites the size attributes and leaves the coordinates alone.
A worked example, including a missing viewBox
Many exports, especially older ones, look like this — a size, but no viewBox:
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"> <circle cx="12" cy="12" r="10" fill="#111827"/> </svg>
If you naively changed width and height to 96, the circle (which lives in a 24-unit space) would sit in the corner of a 96-unit canvas and look cropped. The resizer prevents that. On load it reads the current size, fills the Width (px) and Height (px) fields, and when you download a 96 × 96 version it writes:
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"> <circle cx="12" cy="12" r="10" fill="#111827"/> </svg>
The added viewBox="0 0 24 24" is built from the original width and height. If a viewBox was already present, it is left untouched. Tick Responsive (remove width/height) and the same file is saved as:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"> <circle cx="12" cy="12" r="10" fill="#111827"/> </svg>
That form is what you want for inline icons that should fill a button or a CSS grid cell. Give the element (or its parent) a size in CSS; the graphic keeps its aspect ratio.
How to use the resizer
- Drop an SVG or paste the markup. The preview and the width/height fields show the current size, rounded to whole pixels.
- Type a new width or height. The link button between the fields is on by default (aspect ratio locked), so the other side updates to match. Click it to unlock if you need a different viewport.
- Optionally tick Responsive (remove width/height). The number fields disable, because the file will no longer have a fixed pixel size.
- Download the file (named
-{width}x{height}.svg, or-responsive.svg), copy the markup, or open it in the editor.
Unlocking the ratio does not stretch the drawing
It is reasonable to expect that typing 200 × 100 on a square icon would squash it. In this tool it does not, because the viewBox is never rewritten and SVG's default preserveAspectRatio is xMidYMid meet. The browser fits the square drawing inside the 200 × 100 viewport and leaves empty space on two sides. The element is 200 × 100 — useful if you need to reserve a wide slot in a layout — but the artwork is not distorted.
If you truly need to stretch the paths, that is a different operation (a non-uniform scale, or preserveAspectRatio="none"). This resizer does not do that, on purpose.
Resize, crop, or export a PNG?
Use this page when the canvas is already right and you want a different display size, or a responsive file for CSS. Use Crop SVG when there is empty space around the ink and you want that space gone. Use the editor when you want to change the artboard without scaling the artwork, or to type a size in millimetres for print work.
Resizing an SVG does not produce a bitmap. Social networks, older Office documents and many print labs still want a PNG at a specific pixel size. For that, take the (possibly cropped and resized) SVG to the SVG to PNG converter. SVG vs PNG: when to use each walks through which format the destination actually accepts, and the print guide covers the DPI arithmetic.