Trim Transparent PNG and Crop Whitespace

Choose an image. Transparent margins or a plain-color border are detected and cut away. You can add padding back.

Choose an image to start.

Background
File type

Runs entirely in your browser. Nothing you enter is sent or stored.

How to use

  1. Choose an image.
  2. The tool checks the corners: transparent margins or a plain-color border.
  3. Set padding in pixels if you want space around the result.
  4. Download the trimmed PNG.

If all four corners are transparent (alpha 10% or less), the image is cropped to the pixels whose alpha is above 8 out of 255. Otherwise plain-color rows and columns are trimmed from each edge: a line counts as plain when its sampled pixels differ from its first pixel by 40 or less in R+G+B combined.

Border trimming removes at most a quarter of the width or height from each side.

Use cases & tips

Cleaning up icons, logos and sprites

Exports from design tools often come with a wide transparent margin. A 1200 × 1200 logo may only use a 640 × 580 area in the middle, which makes it float oddly when you place it on a page. Drop the file here and the empty margin is cut away. Then add the same padding, for example 8 pixels, to every file in a set so that icons line up and keep a little breathing room.

Removing white or plain borders

Screenshots, scans and product photos often have a plain white or single-color frame around them. If the corners are not transparent, the tool trims rows and columns that match the edge color. This works well on flat borders and poorly on borders with noise, soft shadows or gradients, because those pixels differ too much from the first pixel of the line. If a strip remains, the cause is usually a faint shadow or JPEG noise, and a manual crop is the faster fix.

Several files, square output and background

You can drop or paste many images at once and download them together as one ZIP. Turn on the square option to center each trimmed image on a square canvas, handy for app icons and profile pictures. You can also fill the background with a color instead of leaving it transparent. JPG cannot store transparency, so it uses white; PNG keeps transparency, and WebP is available in browsers that can save it, which Safari cannot yet.

Check the result before you save

A before and after view shows which area is kept, so you can see at a glance whether anything important was cut. The image is not resized: the result is cut from the original pixels, so quality is unchanged. Compared with cropping by hand in an editor, this saves time when you have many files, but it cannot judge what matters in a picture. If a subtle glow or anti-aliased edge disappears, open the original and crop that one manually.

Frequently asked questions

Why was the border not trimmed?

Border trimming stops after a quarter of the image on each side, and it is cancelled if half of the width or height or less would remain. Lines with noise or gradients beyond the tolerance are kept.

What does padding add?

Transparent pixels on all four sides of the trimmed image.

Is the image resized?

No. The result is cut from the original pixels and saved as PNG.