Add Border to Image

Add Border to Image puts an even solid border on all four sides of one picture: choose a width from 1 to 1000 px and any color. JPG, PNG, WebP and AVIF keep their format; other readable formats become PNG. The border grows outward, so nothing is cropped. Everything runs in your browser and the image is never uploaded.

Drop files here or choose files
Image stays on your device · processed in your browser · one file up to 50 MB

How to use

  1. Choose one image: Drop an image onto the box or click choose files — one file at a time, up to 50 MB. The page reads the picture and shows its size next to the file name, for example Original size: 1200 × 800 px.
  2. Set the width and the color: Type a Border width (px) — any whole number from 1 to 1000; it starts at 40 — and click the Border color swatch to pick the fill; it starts at white. The hint underneath names the exact pixel size the result will have.
  3. Add the border and save: Click Add Border. The line above the result repeats the finished size, and Download saves your file name with -bordered added. JPG, PNG, WebP and AVIF keep their format; other readable formats become PNG. On a phone, Save to device opens the system share sheet when the browser offers file sharing and simply downloads the image when it doesn't.

How to add a border to an image in your browser

Add Border to Image draws a solid frame of one color around all four sides of a single picture. You set two things: the width in whole pixels (1 to 1000, starting at 40) and the color (a swatch, starting at white #ffffff). The border grows outward from the edge of the photo, so nothing is cropped and nothing is covered — a 1200 × 800 photo with a 40 px border comes out 1280 × 880, with the whole original frame complete in the middle. JPG, PNG, WebP and AVIF keep their format; other readable formats become PNG. Either way the file downloads as your own name with -bordered added, such as photo-bordered.jpg.

Nothing is uploaded. The border is drawn by libvips compiled to WebAssembly (wasm-vips 0.0.18), which arrives with the page and runs on your own device: the file is read straight from your disk into memory, and the finished image is handed back as a local link. There is no server call and no account, so this is a free online tool you can also point at an ID scan, an invoice or a family photo, not only at a product shot.

The result lasts only as long as this visit. Close or reload the tab and the local link is gone, there is no history to come back to, and nothing was ever stored off your device — so save the framed image before you leave the page. The original file on your disk is never touched: the tool only ever writes a new one.

The picture is measured the moment you choose it, so you can see what you are about to get. Its pixel size appears beside the file name, and as soon as the width is a whole number in range the hint under the fields spells out the result: 40 px on each side, so the result is 1280 × 880 px — 80 px more in width and in height. If the drop zone accepts a file whose size cannot be read, a note says so and the button still works; you simply learn the finished size after downloading. Changing the width or the color clears the previous result, so what you download matches the settings on screen.

Choosing the border width and the border color

The width is in pixels, not in percent, so the same number looks completely different on different pictures. On a 1200 × 800 photo a 40 px border is a clear margin — about 3% of the long side. On a 4000 px photo straight from a phone camera that same 40 px is a hairline, roughly 1%. There is no percentage setting here, so scale the number yourself: decide what fraction of the long side you want and multiply. For 3% of a 4000 px photo, type 120. The box takes any whole number from 1 to 1000 and turns down anything else — 0, a negative number, a decimal or an empty box — with Border width must be a whole number from 1 to 1000.

The color comes from a swatch rather than a text box. Click Border color, your system color picker opens, and the value handed to the tool is a valid six-digit hex color; white #ffffff is the starting point. Use white for a print-style frame, or black to separate a light photo from a white page. Any brand color works the same way, because the fill is one flat color — there is no gradient, shadow, texture or second frame on offer.

All four sides get the same width, because a single number decides both the offset and the total size: the result is the original width + 2 × border by the original height + 2 × border. So the tool cannot border one side only, cannot use a different width top and bottom, and has no rounded corners. Equal borders change a non-square image's aspect ratio toward 1:1, but cannot make it exactly square. A 1200 × 800 image with a 40 px border becomes 1280 × 880 (16:11). Crop to 1:1 first if you need a square.

Long side of the picture40 px border1% of the long side3% of the long side
800 pxa wide margin (5%)8 px24 px
1200 pxa clear margin (3.3%)12 px36 px
2400 pxa thin line (1.7%)24 px72 px
4000 pxa hairline (1%)40 px120 px

The width is absolute, so the default 40 px reads differently on each of these. Pick the percentage you want and multiply it out — the box accepts 1 to 1000.

Square the picture first with Crop Image, then add the border.

Why the bordered file is usually larger than the original

Adding a border normally makes the file bigger, and the reason is not the frame. The whole picture is decoded and written out again: a JPG or a WebP result is re-encoded at quality 92, an AVIF at quality 72, and a PNG is rewritten losslessly at the highest compression setting. Those settings are often more generous than whatever the original file was saved with, and on top of that the border is real pixels that have to be stored. The measurements below come from this project's own test images on wasm-vips 0.0.18.

The two PNG rows are the clearest evidence that the encode dominates. In a test run that skipped the border entirely, the same 214,657 B PNG came back at 617,284 B — within 0.4% of the 619,757 B it produced with a 40 px border — so almost all of those extra bytes are the fresh encoding, not the frame. The lone row that got smaller is the animated GIF, and only because it lost every frame but the first. Treat all of these as examples of the mechanism rather than a rate to expect from your own file: how much it grows depends entirely on how the original was saved.

If the point was to keep the file small — an upload form, an email attachment, a marketplace listing — add the border first and then shrink the result on purpose, where you can choose the quality and watch the before-and-after size.

InputBorderResult sizeResult file
photo.jpg — 1200 × 800, 541,541 B40 px1280 × 880722,281 B (+33%)
photo.jpg — 1200 × 800, 541,541 B200 px1600 × 1200743,981 B (+37%)
photo.png — 800 × 600, 214,657 B40 px880 × 680619,757 B (+189%)
Grayscale PNG — 800 × 600, 174,060 B10 px820 × 620235,338 B (+35%)
exif-gps.jpg — 64 × 48, 2,322 B10 px84 × 684,171 B (+80%)
anim.gif — 50 × 50, 381 B5 px60 × 60 (PNG)347 B (−9%)

Measured on this project's own test images with wasm-vips 0.0.18, the same engine the page runs in your browser.

Next step for a framed file that is still too heavy: Compress Image.

What the border keeps, and what it changes

Your whole picture survives. The border is added outside the existing pixels rather than drawn over them, so nothing is cropped and no part of the frame is hidden: a 40 × 40 image with a 10 px border is a 60 × 60 image with the original complete and centered. The file format is kept too — JPG in, JPG out; PNG in, PNG out; the same for WebP and AVIF — and there is no format selector and no quality slider to change that.

What is kept but shouldn't be relied on as private is the information written around the picture. EXIF, XMP and the EXIF orientation tag all come through, including GPS coordinates, the capture time and the camera model. In our test, a sample photo with GPS data still reported its coordinates, its capture time and its device model after a 10 px border was added. Adding a border is not a way to strip a photo's history; if the image is going onto a public profile or a listing, frame it here and then remove the metadata with the Compress Image tool, which offers that under its photo info options.

Four things do change in the picture area, and it is worth knowing which before you press the button. Transparency is not preserved: an image with an alpha channel is first flattened against the border color, so the see-through parts become that color and the result is opaque — the page warns you about this as soon as it detects transparency. A grayscale image is converted to sRGB, which is what lets you put a colored border on it, but it means a one-channel file comes out as a three-channel one and gets heavier (174,060 B became 235,338 B in our test). An animation keeps only its first frame. And a JPG, WebP or AVIF result is re-encoded as described above, so fine detail in the original area can shift; only a plain sRGB PNG without transparency is rewritten losslessly, pixel for pixel.

One more substitution catches people out: the format has to be one libvips can write back from the file's own header. JPG, PNG, WebP and AVIF are written back as themselves; a GIF, TIFF, BMP or ICO is written out as a PNG instead, and the page says so before you run it. In our test a 50 × 50 animated GIF with a 5 px border came back as a 60 × 60 PNG holding its first frame.

Limits to know before you add a border

One image per run. Dropping several files at once adds none of them and the page says how many were turned away, so a folder of photos has to go through the tool one at a time. While a file is loaded there is no drop zone on screen at all: switching pictures starts by taking the current one out with the ✕ (Remove) button beside its name, or with Start over once a result is showing. Each file can be up to 50 MB, and the picture you bring has to be under roughly 100 megapixels — about 10000 × 10000 — or it is refused while being decoded, with a message that the image has too many pixels to process safely in the browser. That ceiling is checked on your input only, which is one reason the width box stops at 1000.

This is a rectangular border and nothing else. It cannot follow the outline of a subject, so a cut-out PNG of a person or a product will not get the sticker-style white edge that hugs its shape — it gets a rectangle around the whole canvas, and its transparent background is filled with the border color on the way. It cannot add a gradient, a shadow, a double frame or a picture-frame texture, cannot rotate or resize anything, and only accepts images: the file picker is limited to image files, and bytes that are not a readable image come back as a message saying so.

The work happens on the page's main thread, so with a very large photo the interface can pause for a moment; while it runs, the button reads Adding border… and is disabled. Afterwards the result is shown as an image preview, which your browser may rotate upright if the photo carries an orientation tag — the border is added around the stored pixels, and because all four sides are equal it still looks even once a viewer turns the picture the right way up. Saving depends on the device: on a computer the file downloads, and on a phone it goes to the system share sheet when the browser supports sharing files, falling back to a normal download when it doesn't.

HEIC photos from an iPhone are worth a word of warning. This tool decodes with libvips only, while HEIC is handled by a different decoder elsewhere on the site, so a HEIC file may be refused here as not a readable image; we haven't measured it. If that happens, convert the photo to JPG first and add the border to the JPG.

For an iPhone photo that won't load, convert it first with HEIC to JPG Converter.

How this tool is checked

  • The logic behind this tool is covered by 15 automated test cases (hand-checked examples, edge cases and invalid input), and they run again before every release.
  • Before each release, a real browser opens this page, runs it on sample files (including a damaged one) and checks the file it produces.
  • Your files are processed in your browser and are never uploaded to our server.
  • Formulas, figures and definitions are checked against the sources listed at the end of this page.

How we build and test our tools →

Frequently asked questions

Does adding a border crop or cover part of my photo?
No. The border is added outside the existing pixels, so the picture is not cropped and no part of it is hidden — a 40 × 40 image with a 10 px border becomes 60 × 60 with the original complete in the middle. The width and height each grow by twice the border.
Why is my file bigger after adding a border?
Because the whole picture is written out again, not just the frame. JPG and WebP results are re-encoded at quality 92 and PNGs are rewritten at maximum lossless compression, which is often more generous than the original file. A 541,541 B test JPG came back at 722,281 B with a 40 px border.
Can I add a white border to a photo to make it square for Instagram?
Not in one step. Equal borders change a non-square image's aspect ratio toward 1:1, but cannot make it exactly square: a 1200 × 800 image with a 40 px border becomes 1280 × 880 (16:11). Crop to 1:1 first if you need a square — with the Crop Image tool, then add the white border here, because a square plus an equal border is still a square.
What happens to a transparent PNG?
It loses its transparency. An image with an alpha channel is flattened against the border color first, so the see-through areas become that color and the result is an opaque file with no alpha channel. The page warns you as soon as it sees transparency in the picture you chose.
Can I add borders to several photos at once?
No, one image per run. Dropping several files together adds none of them and the page tells you how many were turned away, and while a file is loaded there is no drop zone, so the next photo starts with the ✕ (Remove) button or Start over. For a whole folder in one pass you need a desktop or command-line tool.
Does adding a border remove the GPS location from a photo?
No. EXIF, XMP and the orientation tag all stay in the result, GPS coordinates included — a test photo still reported its coordinates, capture time and camera model after a border was added. To strip them, add the border here and then use the Compress Image tool's photo info options.
What happens to an animated GIF?
Only its first frame survives, and it comes out as a PNG. The border engine writes back JPG, PNG, WebP and AVIF as themselves, and anything else — GIF, TIFF, BMP, ICO — is saved as a PNG. In our test a 50 × 50 animated GIF with a 5 px border produced a 60 × 60 still PNG.
Is my image uploaded anywhere?
No. libvips compiled to WebAssembly is downloaded with the page and runs in your browser, reading the file from your disk and returning the result as a local link, with no server call and no sign-up. The isolation that engine needs also keeps ads and analytics off this page. Close the tab and nothing is left.

Add this tool to your website

Free for any website, personal or commercial. Paste the code where you want the tool to appear — it works on WordPress, Blogger, Google Sites, Notion and plain HTML.

This tool needs a browser mode that only works on its own page, so the embed shows a card with a button that opens it in a new tab.

<div class="gingertool-widget" data-embed="https://gingertool.com/embed/en/image/add-border-to-image/" data-height="240" style="font-size: 13px; line-height: 20px; margin: 6px 0 16px; text-align: left">Add Border to Image &#183; <a href="https://gingertool.com/en/image/add-border-to-image/">Gingertool</a></div>
<script src="https://gingertool.com/embed.js" async></script>

Please keep the credit link below the tool. Embedded tools show no ads.

Step-by-step: Google Sites · Blogger · WordPress · Notion

Cite this tool

Using a result in a report, paper or assignment? Copy a ready-made reference.

APA
Gingertool. (2026). Add Border to Image [Online tool]. Retrieved November 27, 2026, from https://gingertool.com/en/image/add-border-to-image/
MLA
“Add Border to Image.” Gingertool, November 27, 2026, https://gingertool.com/en/image/add-border-to-image/. Accessed November 27, 2026.
BibTeX
@misc{gingertool-border-image,
  author = {{Gingertool}},
  title = {Add Border to Image},
  year = {2026},
  url = {https://gingertool.com/en/image/add-border-to-image/},
  note = {Accessed: 2026-11-27}
}