Compress AVIF images to a chosen KB or MB limit
The Compress AVIF to Size tool is for situations where an image needs to be delivered in the AVIF format while staying near a specific file-size ceiling. You can begin with a preset such as 10 KB, 20 KB, 50 KB, 100 KB, 200 KB, 500 KB, 1 MB or 2 MB, then enter a custom maximum when your upload form or website gives a different limit. The custom field accepts a range from 5 KB to 10,000 KB. The setting is a maximum target, not a request to create a file with an exact byte count.
AVIF is a modern image format based on the AV1 image coding technology. It can be useful for web photography and graphics when the destination supports it, but not every older application or upload portal accepts AVIF. This tool always produces an AVIF file. Its file picker is broader than the route name suggests: it allows AVIF as well as common browser-readable image inputs such as JPG, PNG and WebP. Those files are encoded into AVIF output during processing. Check the output format requirement of the receiving service before converting a source image.
The compression process runs through the TinyImageResizer server API using the Sharp image library. This is different from the browser-only Canvas tools on the site: the selected image file is sent to the server for encoding. Do not describe this workflow as entirely local or as a no-upload compressor. The server produces an AVIF result and the interface provides a download. If you select multiple files, the tool packages the converted outputs in a ZIP archive.
Choose a target and encoder speed
The target size control offers popular limits and a custom field. A lower target can require stronger compression, smaller pixel dimensions or both. A 10 KB target is extremely restrictive for many photographs, while a 500 KB or 1 MB ceiling gives a larger image more room to retain detail. A simple icon or flat graphic may reach a small target more easily than a detailed photograph with texture, noise and many colour transitions.
The Encoder Speed control ranges from 1 to 8. Lower settings are described in the interface as slower encoding for smaller files; higher settings prioritize faster encoding. The backend converts this setting into the AVIF encoder effort value. Choose a slower setting when file size is the main priority and you can wait longer. Choose a faster setting when you are processing a batch and speed matters more. Speed is an encoder trade-off, not a quality slider with a guaranteed result.
The Keep Exact Dimensions option controls whether the tool may reduce the image's pixel width and height. Leave it enabled when exact pixel dimensions are part of the specification. Turn it off when the target size is more important and proportional downscaling is acceptable. If dimensions are locked, the encoder may only be able to reduce quality so far; the resulting AVIF can remain above the requested maximum. If dimensions may change, the server can try smaller proportional sizes, but there is still no guarantee that every file will fit.
How to compress an image to AVIF
How the AVIF size search works
The backend first encodes a low-quality AVIF candidate to test whether the requested target is achievable at the current dimensions. When that candidate is small enough, it uses a short quality search to find a higher quality value that remains within an internal safety buffer below the target. If the candidate is too large and dimension changes are permitted, the encoder can run further passes at smaller proportional dimensions. The goal is to find a usable balance between file size, visible detail and pixel resolution.
There are limits to that search. When Keep Exact Dimensions is on and the lowest tested quality still exceeds the target, the tool returns that smallest attempted result rather than making the dimensions smaller. When dimension reduction is enabled but the search cannot find a candidate within the ceiling, the fallback path may also return a file above the target. The response includes a target-hit indicator for a single result, so pay attention to the achieved-size status. The batch ZIP summary has less reliable aggregate status reporting, so check individual files from the archive rather than assuming every image met the limit.
Where a target-size AVIF is useful
Privacy, compatibility and final checks
Because AVIF compression is performed on the server, selected files are transferred to TinyImageResizer's processing endpoint. Do not use this page for confidential images unless the service's current privacy terms are acceptable for your use. The encoder requires a file format that the server's image library can decode. The input picker is broad, but a file being selectable does not mean every proprietary or unusual image type is guaranteed to work.
After downloading, check four things: the file opens, the extension and actual format are AVIF, the pixel dimensions still meet your needs, and the achieved file size is below the receiving limit. If the result misses the target, try a slower encoder speed, allow proportional downscaling when appropriate, or select a larger target. Use a different output format when the receiving system does not support AVIF.
Frequently Asked Questions
Set a maximum file size for AVIF images and balance encoding speed with dimensions
Does this tool compress images to AVIF?
Can I set a custom AVIF file-size target?
Does the tool support MB targets?
Can I keep the original pixel dimensions?
What does Encoder Speed change?
Can I compress several images at once?
Are images processed only in my browser?
Will every image finish below the target?
Does AVIF work in every website or application?
What should I check before uploading the AVIF?
Compress to a specific size
Choose a target size for forms, portals and uploads.
Related Tools
Explore more tools to optimize, convert, and manage your images.
Compress to 100KB
Compress JPG, PNG, and WebP images to strictly 100KB or less without losing clarity. Ideal for online forms and attachments.
Bulk Image Resizer
Resize multiple images at once with our free bulk image resizer. Batch resize JPG, PNG and WebP photos to any size in seconds.
HEIC to JPG
Convert HEIC to JPG online for free. Change iPhone and iPad HEIC or HEIF photos to JPG that open on Windows and Android. Batch conversion supported.
JPG to PDF Converter
Convert JPG images to PDF online free. Combine multiple photos into one PDF with custom margins, page size and orientation. 100% private, no signup.



