Add a border to an image
A frame, or bars that make the picture fit a shape without cutting anything off.
JPG, PNG, WebP, HEIC, AVIF and BMP. Your file is processed on your device.
How do I add a border to an image?
The half of the problem cropping cannot solve
Every tool on the internet will crop an image to a required shape. Far fewer will do the opposite, and the opposite is often what you actually want. A 4:5 portrait that has to become a 1:1 avatar can lose the top of somebody’s head, or it can gain two strips of white. Only one of those is reversible, and only one of them keeps the picture you took.
Padding is also the answer when the subject reaches the edge of the frame — a product shot where the item is already tight against the sides, a screenshot that a marketplace will display against a white background anyway, a logo that needs breathing room before it goes into a header.
Three ways to describe what you want
An even border is the picture-frame case: the same margin on all four sides, given in pixels or as a percentage. Percentages are usually the right choice, because the same number then works on a phone photo and on a scan.
Fit a shape takes an aspect ratio and adds bars to the shorter axis until the frame matches it. Nothing is added to the longer axis and nothing is ever removed, so the picture inside is untouched at full size. This is the setting for “make it square”, “make it 16:9”, and any other requirement that is about shape.
Exact canvas puts the image, centred, on a canvas of the precise dimensions you type. If the image is bigger it is scaled down to fit; if it is smaller it sits at its own size with space around it. Use it when a destination specifies exact pixel dimensions and you would rather letterbox than crop — the image resizer is the tool that crops to reach the same numbers.
Choosing a colour
White is the default because most destinations that show images on a background show them on a white one, and a white bar disappears into the page. Black suits photographs that are predominantly dark and reads as deliberate rather than accidental. A colour picked out of the image itself usually looks best of all, and there is a custom picker for exactly that.
Transparent is a genuinely different thing. It means the border is not there at all — the image simply occupies a larger canvas with nothing in the extra space, so whatever the image is placed on shows through. That is what you want for a logo going into a design, and it requires PNG or WebP, because JPEG has no way to record “nothing here”.
When to crop instead
Bars cost you screen area. A 16:9 photograph padded out to a square spends over forty per cent of the frame on empty space, and in a feed of thumbnails that reads as a small image with a big margin. If the subject sits comfortably inside the frame and the shape change is modest, cropping produces a better-looking result and the cropper is the right tool. Crop, or add borders? works through the cases where each one wins.
Common questions
- How do I make a photo square without cropping it?
- Choose "Fit a shape" and pick 1:1. Bars are added to whichever side is shorter until the frame is square, and not one pixel of the photograph is removed. This is the standard fix for a portrait photo that a square feed would otherwise crop through somebody’s head.
- Can the border be transparent?
- Yes, if the output format can store transparency — PNG and WebP can, JPEG cannot. Choosing a transparent border switches the output to PNG automatically, and you can override that. If you force JPEG anyway the page warns you, because a transparent border in a JPEG becomes solid colour, usually black, and looks like a bug rather than a choice.
- Why is the percentage measured against the short edge?
- So the border looks even. If five per cent meant five per cent of the width at the sides and five per cent of the height at the top, then on a wide photograph the side bars would come out visibly thicker than the top and bottom ones. Measuring both against the shorter dimension gives four bars of the same width, which is what "a five per cent border" means to anybody looking at it.
- Does adding a border make the file bigger?
- Slightly, but much less than you would expect. A flat area of one colour compresses extremely well — a wide white bar might cost a few kilobytes. If the destination has a file size limit, set it under output options and the border and the limit are handled in the same pass.
- Will it enlarge a small image to fill an exact canvas?
- No. On "Exact canvas" a picture larger than the canvas is scaled down to fit, and one smaller than the canvas is centred at its own size with space around it. Enlarging cannot add detail that is not in the file, and a tool that quietly upscales to fill a box hands you a soft image without saying that it did.