> ## Documentation Index
> Fetch the complete documentation index at: https://autorender.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Pad resize

> Fit a video into fixed dimensions with padding and a background color.

`cm_pad_resize` scales a video to fit inside a fixed box and pads the empty space so the full frame stays visible. Set the padding color with `bg_` to avoid black letterboxing. Use it for consistent card sizes and fixed aspect-ratio layouts.

## How to use it?

Set the box with `w_` and `h_`, add `cm_pad_resize`, and choose a padding color with `bg_`. The example below fits the source into a **400×400 px** box (`w_400,h_400`) with white padding.

```text theme={null}
https://assets.autorender.io/LOKVTtKVGb/w_400,h_400,cm_pad_resize,bg_white/doc/skateboarding.mp4
```

<video src="https://assets.autorender.io/LOKVTtKVGb/w_400,h_400,cm_pad_resize,bg_white/doc/skateboarding.mp4" controls />

| Token | What it does |
| - | - |
| `cm_pad_resize` | Resize to fit the box and pad to the exact dimensions |
| `bg_{color}` | Padding color as a name (`bg_white`, `bg_black`), hex (`bg_FF0000`), or blur (`bg_blurred`, `bg_blurred_10`) |

> [!TIP]
>
> Pair a blurred background (`bg_blurred`) with `cm_pad_resize` when you want the padding to echo the video instead of a flat color — it keeps a widescreen clip looking intentional inside a square card.

## Next steps

> [card] [Resize & aspect ratio](https://autorender.io/docs/video/resize.md)
>
> Compare pad resize with the crop fit mode and ratio tokens.

> [card] [Video overview](https://autorender.io/docs/video/introduction.md)
>
> Every video transform token in one reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.