Image Padding Tool

Add space around an image without stretching it.

1. Choose image & settings

Still JPEG, PNG or WebP. Up to 20 MiB, 8 MP and 4096 px per side.

No image selected.

The original image stays at its original pixel size. JPEG requires a solid background.

Select an image to begin.

2. Preview & download

No image
No output yetApply the settings to create an output.
Your image preview will appear here.

Processed locally, same file format. Exports may remove metadata and re-encode lossy formats.

How to add padding to an image

Use this tool to add space outside the four edges of an image. The picture keeps its pixel dimensions; the canvas around it grows.

  1. Select Choose image and open a supported still JPEG, PNG or WebP. Read its displayed width and height.
  2. Enter the padding in Left (px), Right (px), Top (px) and Bottom (px). Each field starts at 20 px on a fresh form. Enter 0 on an edge where you do not want extra space.
  3. Leave Transparent padding checked for clear margins on PNG or WebP, or uncheck it and choose a Background color for a solid fill. JPEG always uses a solid color.
  4. Check the Output dimensions below the settings, then select Add padding. Inspect the resulting image, dimensions and format in Preview & download, and select Download image to save the new file.

The preview before applying the settings shows the original; select Add padding to see the padded result. Changing settings clears the previous download. You can apply different margins again to the loaded original without accumulating the earlier padding. The four margin values carry over when you choose another file, but the transparency setting follows the new format. Recheck both; Reset clears the file and restores the default 20 px margins and white color.

The tool processes the selected file locally in your browser, without uploading it to an image-processing server or changing the original. It handles one image at a time and saves in the input format.

Calculate the padding for exact pixel dimensions

Add the margins to the source width and height, not to the on-screen preview size:

  • Output width = image width + left + right.
  • Output height = image height + top + bottom.

A 900 × 600 px picture with 25 px on every side becomes 950 × 650 px. That is 50 additional pixels on each axis, not 25. Enter the same number in all four fields for an even frame, and different numbers to move the picture within the new canvas.

Suppose you need a 1200 × 800 px image from that 900 × 600 px source, with extra room on the right and bottom for labels in a later layout.

Field Enter
Left (px) 80
Right (px) 220
Top (px) 40
Bottom (px) 160
Output dimensions 1200 × 800 px

The left and right margins sum to 300 px; the top and bottom sum to 200 px. The original 900 × 600 px picture starts 80 px from the left edge and 40 px from the top edge of the result. The tool reserves the blank area; it does not add the labels.

To reach a different target size, subtract the source width from the target width and the source height from the target height. Divide each difference between the two corresponding sides. Both differences must be nonnegative.

To center the image, split each difference in half, using whole pixels. When the difference is odd, assign the extra pixel to one side. For a left-aligned picture, enter 0 for Left and put the entire horizontal difference in Right. For a bottom-aligned picture, put the vertical difference in Top and enter 0 for Bottom.

Add padding by percentage

The fields accept pixels, not percentages. Convert the percentage to pixels first. For example, if your specification means 10% of the original width for each of Left and Right, and 10% of the original height for each of Top and Bottom, a 1000 × 600 px image needs Left 100, Right 100, Top 60 and Bottom 60. The result is 1200 × 720 px.

If a specification uses a single reference dimension for all four sides, calculate the margin from that dimension instead. Round to whole pixels, then check the final size; rounding each margin independently can change the exact ratio.

Make an image square or change its aspect ratio without cropping

Padding changes the outer shape of an image without cutting off the subject. For a square, use the longer side of the original as both target dimensions, then add the missing space to the shorter axis.

Original Left Right Top Bottom Square output
1200 × 801 0 0 199 200 1200 × 1200
801 × 1200 199 200 0 0 1200 × 1200
800 × 800 0 0 0 0 800 × 800

All dimensions and margins are in pixels. The odd difference of 399 px cannot be split into two equal whole-pixel margins; 199 and 200 keep the image as close to centered as possible. If you want space around every edge of a square, add the same additional margin to all four sides after working out the square.

Pad to an exact widescreen or portrait ratio

This tool does not automatically calculate margins from a ratio. If you know the desired output dimensions, use the subtraction method above. If you only know the shape, find the smallest exact whole-pixel canvas that can contain the original.

For a reduced width-to-height ratio a:b, choose the smallest whole number k for which both a × k is at least the source width and b × k is at least the source height. Equivalently, round up the larger of source width ÷ a and source height ÷ b. The target is (a × k) by (b × k). Then distribute the spare width and height among the four edges.

For a 1001 × 600 px image and an exact 16:9 target:

  • Width requires at least 63 groups of 16 pixels; height requires at least 67 groups of 9 pixels.
  • Use 67 groups on both axes: 1072 × 603 px.
  • Enter Left 35, Right 36, Top 1 and Bottom 2.

Simply rounding 1001 × 9 ÷ 16 to a whole-pixel height does not solve this case: the image is already taller than that height, and 1001 is not a multiple of 16. The 1072 × 603 canvas has exactly the requested ratio and fits the whole original. Use the aspect ratio calculator to reduce a custom ratio or check the output ratio before exporting. If you require a fixed pixel size as well, use that size rather than the smallest matching canvas, provided it has the requested ratio and can contain the image. If even the smallest exact canvas exceeds the output limits below, no larger canvas of that ratio can fit those limits.

Choose transparent, white or colored padding

The downloaded file keeps the original format. JPEG does not store transparency, so Transparent padding is disabled for a JPEG and the selected solid color is used. When a supported PNG or WebP is loaded, transparency is checked initially. To add a white border, uncheck it and choose white (#ffffff); to match an existing layout, select its background color.

There are two important differences between the fill choices:

  • Transparent padding: adds clear pixels outside the original image and retains its existing transparency. It does not remove an opaque background already in the picture.
  • Solid background: fills the entire expanded canvas before drawing the original image over it. If a logo has transparent holes or semitransparent edges, those areas will also show or blend with the chosen color. This is not a border-only fill that preserves transparency inside the original rectangle.

The distinction follows the browser’s default source-over compositing behavior. For example, if a transparent PNG logo needs clear space for use on different backgrounds later, keep Transparent padding checked. If the entire canvas must be opaque white, turn it off and choose white. Check transparency in an image viewer that shows it explicitly; an apparently white preview does not necessarily mean the file contains white pixels.

If you need transparent margins on a JPEG, you need a supported PNG or WebP source instead. Renaming a JPEG with a .png extension does not give it transparency, and this padding tool does not convert formats.

When padding alone cannot reach the target

Padding cannot make a canvas smaller than its original on either axis. For example, a 1600 × 900 px picture cannot fit inside 1200 × 1200 px at its original scale, even though the target is taller. Do not enter negative padding to try to remove the excess width.

Use the operation that matches the job:

  • Keep the exact source dimensions and extend particular edges: use this padding tool.
  • Keep the full scene inside a smaller or fixed-size canvas: use the image resizer with Fit & Pad.
  • Remove existing margins or unwanted areas: use the image cropper.

For the 1600 × 900 to 1200 × 1200 example, choose the original in Image Resizer. In Advanced settings, set Resize by to Pixels and Resize mode to Fit & Pad. Turn off Lock aspect ratio if checked, enter Width 1200 and Height 1200, leave Allow enlargement off, choose the Center anchor and set the background. Select Resize image. The image scales to 1200 × 675 px, with 262 px of space above and 263 px below. The output is exactly 1200 × 1200 px. Unlike padding alone, this workflow resamples the picture.

Adding blank space does not extend the photographed scene or create new image detail. The margins here are pixels, not physical print lengths. If you need a particular print size, calculate the required canvas dimensions first.

Input limits and why Add padding is unavailable

A supported source must be a still JPEG, PNG or WebP, no more than 20 MiB (20,971,520 bytes). Both the original and the expanded canvas must have at most 4096 px on either side and at most 8,000,000 pixels in total.

Enter nonnegative whole numbers for every margin. Blank, negative and fractional entries are invalid. The tool checks the resulting dimensions together; a padding value can be too large even when each individual field looks reasonable.

For example, a 4000 × 1950 px source fits the limits, but the default 20 px on all sides produces 4040 × 1990 px, or 8,039,600 pixels. This exceeds the area limit even though both sides are under 4096 px.

If you only need more height, set Left and Right to 0, Top and Bottom to 25. The result is 4000 × 2000 px, exactly 8 million pixels. Adding just one more pixel of height would exceed that limit. For a source that is already 4096 px wide, leave both horizontal margins at 0.

Reduce the padding or choose a smaller target if the required layout allows it. If the source must be scaled first, use the resizer or a compatible editor. If the required output exceeds the tool’s limits and must stay that size, use an editor with a larger canvas limit.

If a file is rejected before you can enter settings, check its actual format, file size and dimensions. Animated images and malformed or unsupported files are not accepted. Use the displayed, orientation-adjusted dimensions for supported JPEGs. A still PNG or WebP with an EXIF rotation or flip tag (values 2–8) can also be rejected. If so, apply the intended orientation to the pixels in a trusted local editor and export a supported still copy with the tag set to 1 or omitted. Check that it faces the right way; simply deleting the orientation tag can leave the picture incorrectly rotated.

Quality and the downloaded file

The original picture is drawn onto the new canvas at the same pixel size, with no scaling. That does not mean the downloaded file is identical to the original.

PNG stores the rendered result with lossless compression, but the browser may change color representation, bit depth or alpha handling when decoding and drawing. JPEG is encoded again and can lose detail; WebP may also be encoded lossily. The tool uses the browser encoder rather than offering a quality slider. Even zero padding on all four sides creates a new encode. Original color profiles, EXIF and print-density metadata are not guaranteed to be retained.

See the image format guide and canvas export documentation for the format and encoding differences.

Nonzero padding increases the number of pixels, but the encoded file may grow by a different proportion or even become smaller because it is re-encoded. This tool reports the output size rounded up in KiB and checks the output against a 40 MiB ceiling, as well as its format and dimensions. If the browser cannot encode the expected format or the output cannot be verified, the tool reports an error instead of enabling a download. Try a compatible browser or supported copy if needed.

Check the downloaded result against the required pixel dimensions, format, transparency and actual byte limit. The image dimensions checker can confirm the dimensions and exact byte count if the saved file meets its input limits; otherwise inspect the saved file using a compatible local viewer. Keep the original so you can retry without repeatedly re-encoding the last output.