Skip to content
UniKit

Image padding

Add white, transparent or coloured padding around an image (per side), optionally expanding it into a 1:1 square canvas.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Images are processed locally in your browser with Canvas and never uploaded.

24px

Blank or "transparent" keeps the padding transparent, or enter #ffffff.

Pick an image first (PNG / JPEG / WebP / GIF all work).

Result details

Result details

Pick an image and the padded preview shows up immediately.

What this tool does

  • Normalise upload sizes: pad landscape and portrait images into the same square canvas so grid layouts stop jumping.
  • Reserve a caption area: add extra padding at the bottom and drop a title or price straight into it.
  • Create transparent margins: pad with "transparent" and export PNG so the image drops onto any background without a white box.
  • Expand to 1:1: tick "expand to a square" to centre the image and only add pixels, which suits platforms that demand a square without cropping.

Example

Input

2 × 2 image, 1 pixel of padding on each side, colour blank

Output

Padding 1 / 1 / 1 / 1\nOutput size 4 × 4 (16 pixels)\nPadded pixels 12

This is the real output of the pure pixel logic: the output is 2 + 1 + 1 = 4, the 2 × 2 source is placed at (1, 1), and the remaining 12 pixels take the background colour (transparent by default).

Frequently asked questions

How is padding different from image tiling?

Padding only grows the canvas and keeps the source where it is, adding a border; tiling repeats the source across the whole canvas. Use padding for borders and tiling for textures.

Does "expand to a square" crop anything?

No. It uses the longer edge as the side length and pads symmetrically, so the source is kept in full and centred — pixels are only added.

What happens with a blank padding colour?

Blank (or "transparent") gives the new border alpha 0, which PNG keeps. A colour such as #ffffff produces a solid border, so a JPEG export has no black edges.

How much padding is allowed?

0–4096 pixels per side, with a maximum output canvas of 16,000,000 pixels; larger requests report an explicit padding error.

Are my images uploaded?

No. Decoding, padding and encoding all happen in browser memory; there is no upload endpoint, so it works offline.

Keywords:padding

Related tools