Compressor.js is a lightweight JavaScript library for in-browser image compression that allows developers to reduce file sizes before uploading images to a server, improving performance and user experience. It works by taking an input image (such as from a file input) and resizing or reencoding it on the client side according to developer-specified options like maximum width, height, quality, and MIME type. Because compression happens in the browser, users upload smaller images without sacrificing responsiveness or relying on server resources, which is especially useful for mobile users or limited-bandwidth environments. The library supports modern browsers and automatically handles orientation based on EXIF metadata, ensuring images appear correctly after compression.

Features

  • Compressor.js is a lightweight JavaScript library for in-browser image compression that allows developers to reduce file sizes before uploading images to a server, improving performance and user experience. It works by taking an input image (such as from a file input) and resizing or reencoding it on the client side according to developer-specified options like maximum width, height, quality, and MIME type. Because compression happens in the browser, users upload smaller images without sacrificing responsiveness or relying on server resources, which is especially useful for mobile users or limited-bandwidth environments. The library supports modern browsers and automatically handles orientation based on EXIF metadata, ensuring images appear correctly after compression. Compressor.js exposes both promise-based and callback APIs, making it easy to integrate into existing workflows or custom upload pipelines. Its minimal footprint and simplicity mean developers can quickly add client-side compression without pulling in heavy dependencies or complex build steps.
  • Resize by maximum width and height constraints
  • Configurable output quality and MIME type
  • EXIF orientation handling for correct display
  • Promise and callback API support
  • Lightweight with no external dependencies

Project Samples

Project Activity

See All Activity >

Categories

File Compression

License

MIT License

Follow Compressor.js

Compressor.js Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Compressor.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript File Compression Software

Registered

7 hours ago