SquareImage

Add a White Border to a Photo

Add a 20 px white border on all four sides, or choose your own widths and color. The canvas grows; your photo stays the same size.

How can I add a white border to a photo?

SquareImage.dev adds a 20 px white border to all four sides by default, without cropping, stretching or forcing the photo into a square. Choose separate widths or pad to 1:1, 4:5 or 16:9 without scaling the photo. Set a custom color or use a transparent border. The browser exports one PNG at a time, with a limit of 10,000 px per side and 24 megapixels. The photo is not uploaded.

By · Verified

What does a 20 px white border look like?

Astronaut Bruce McCandless above Earth, without a border
Before: 480 × 480 px
The same astronaut photograph framed by a white border on all four sides
After: 520 × 520 px

Source: NASA photograph S84-27017, public domain in the United States, via Wikimedia Commons. The source was resized for this example. The after image was exported with Equal border at 20 px and white (#FFFFFF).

Which border mode should I use?

  • Equal border gives each edge the same margin. A 20 px border adds 40 px to both the width and the height.
  • Custom sides sets top, right, bottom and left separately. Set any side to 0 to leave it unchanged. The output adds left plus right to the original width, and top plus bottom to the original height.
  • Aspect ratio padding fits the whole photo inside the smallest canvas with the exact ratio you choose: 1:1, 4:5 or 16:9. It centers the photo without resizing it. If the spare space is odd, the extra pixel goes on the right or bottom. These are layout choices, not upload requirements.

Need a fixed pixel size rather than a border? Use the exact square image resizer. For a blurred background instead of a solid color, see how to make an image square without cropping.

Frequently asked questions

Does adding a white border make my photo square?

No. Equal border adds the same number of pixels to all four edges, regardless of the photo’s shape. Choose 1:1 under Aspect ratio padding if you want a square canvas without cropping or scaling the photo.

Can I add a border to only one side of an image?

Yes. Choose Custom sides, enter the width you want on that side, and set the other three widths to 0.

Can I download a photo with a transparent border?

Yes. Select Transparent and download the PNG. The new border is clear, and any existing transparency in the image is preserved even if you choose a solid border color.

Every tool on this site draws your photo onto an HTML canvas and reads the result back out — that is the whole pipeline, which is why nothing is uploaded and why the export size behaves the way it does. The browser's own documentation describes the drawing step:

“drawImage() will always use the source element's intrinsic size in CSS pixels when drawing, cropping, and/or scaling.”
— MDN Web Docs, CanvasRenderingContext2D: drawImage() method

Sources

Links checked 2026-11-19.