Skip to content

Add Border to Image

Add a solid 1–500 pixel border around a local JPG, PNG, or WebP and download a full-resolution PNG.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Choose a local JPG, PNG, or WebP within the displayed file limit.
  2. 2.Set a whole-number border width from 1 to 500 pixels and choose a solid color.
  3. 3.Select Add border, verify the expanded dimensions, and download the PNG.

About Add Border to Image

Add Border to Image places an even solid-color frame around a local JPG, PNG, or WebP without uploading it. Choose a file, set a whole-number border from 1 to 500 pixels, pick a color, and download the result as a PNG.

The border is added outside the original image. A 20-pixel border increases both width and height by 40 pixels, leaves every source pixel at its original coordinate scale, and positions the source at x=20 and y=20. The tool does not crop, stretch, resample, blur, or cover the source image. Eight geometry fixtures cover tiny, portrait, landscape, square, large, one-pixel, and 500-pixel boundaries.

Input uses the shared image safety policy: JPG, PNG, or WebP up to 25 MiB with bounded decoded dimensions. The output is also checked against a 20-megapixel canvas limit after adding the border. Invalid dimensions, unsupported files, malformed colors, excessive border sizes, decode failures, missing canvas support, and empty PNG output fail visibly.

Canvas first fills the expanded area with the selected six-digit hexadecimal color, then draws the decoded source once at the border offset. Output is always PNG, so source JPEG compression is decoded and re-encoded and the file size can increase. Existing transparent pixels remain transparent inside the image, while the new outer border is opaque.

File bytes, decoded pixels, canvas, and the temporary download URL stay in the current browser tab. Changing the file, size, or color invalidates the previous result and releases its Object URL. A stale asynchronous export cannot replace a newer choice.

This tool creates a rectangular solid frame only. It does not add rounded corners, decorative patterns, gradients, shadows, captions, print bleed, color profiles, or vector borders. For color-managed printing, exact physical dimensions, batch processing, layered editing, or non-destructive design work, use a desktop image editor.

Methodology & sources

Validate a bounded local image and decoded pixel budget, parse a whole-number 1–500 pixel border and six-digit hexadecimal color, calculate output width and height by adding twice the border, reject output above 20 megapixels, fill the expanded canvas with the chosen opaque color, draw the source once at equal x/y offsets, encode PNG, reject empty output, invalidate stale jobs, and revoke replaced Object URLs.

Frequently asked questions

Does the border cover the image?
No. The canvas expands evenly on all four sides, so source pixels are not covered or resized.
Why is the output PNG?
PNG provides a dependable browser canvas export and preserves any transparency inside the source image.
Can I add different widths to each side?
No. This focused tool applies one equal width to all four sides.
Is the image uploaded?
No. Decode, drawing, PNG encoding, and download creation happen locally in the browser.

Image Tools guides

View all