# Why does my Lottie animation have large padding, and how do I remove it?

> The padding comes from the After Effects composition size, which is saved in the file as its width and height. The cleanest fix is to crop the composition to the artwork in After Effects and export again. If you cannot, scale the player instead: use preserveAspectRatio "xMidYMid slice" on the web, centerCrop or a scale on Android, and scaleAspectFill on iOS.

Updated November 2026. Source: https://www.exodeui.com/questions/how-to-remove-lottie-padding/

## Key takeaways

- Lottie keeps the full composition canvas, including empty space
- Best fix: crop the comp to the artwork and re-export
- Web: rendererSettings.preserveAspectRatio "xMidYMid slice"
- Android: scaleType centerCrop or a scale factor
- iOS: contentMode .scaleAspectFill

## Frequently asked questions

### Can I remove Lottie padding with CSS only?

You can hide it by scaling the player inside a container with overflow hidden. The file still contains the empty canvas.

### What does preserveAspectRatio slice do?

It scales the drawing to fill the container and crops what overflows, like background-size: cover.

### Will cropping the comp break the animation?

Only if shapes move outside the new bounds. Scrub the whole timeline after cropping and leave a margin.

### Can I trim a Lottie without After Effects?

Yes. Browser editors such as Lottie Creator can change the canvas and trim frames.

## Related

- [How to convert After Effects to Lottie](https://www.exodeui.com/questions/how-to-convert-after-effects-to-lottie)
- [Why is my Lottie animation playing too fast?](https://www.exodeui.com/questions/why-is-my-lottie-animation-playing-too-fast)
- [How to change Lottie colours](https://www.exodeui.com/questions/how-to-change-lottie-animation-color)
- [Best Lottie editors](https://www.exodeui.com/best-lottie-editors)
