What Is The Best JavaScript/jQuery Lightbox Plugin?

Choose the right plugin for you. Compare sizes, dependencies and other key options.

Criteria are similar to slider or carusel comparison:

  • all plugins are responsive
  • touch gestures (swipe) support is compared
  • the cost is 0, free to use

Actually, there is a little exception, when talking about the price. Fancybox has free licence for open source projects, but paid in commercial use. But thanks to its popularity, it is included in the table.

Caption configuration, and arrow keys navigation are available in all plugins.

JavaScript/jQuery Lightbox Plugins Comparison

Name Dependency Size Swipe Note
baguetteBox no 9kB (JS)
4kB (CSS)
yes Very tiny, but with all usually needed functions.
fancybox jQuery 59kB (JS)
14kB (CSS)
yes Popular lightbox does (almost) everything. Problematic is a licence. Docs of version 3 are worse than 2.
FeatherLightGallery jQuery 13kB (JS)
4kB (CSS)
no Basic and easy to use. CSS styling not very fancy.
halkaBox no 14kB (JS)
8kB (CSS)
yes Simple, but preferable over previous one.
Lightbox jQuery 10kB (JS)
3kB (CSS)
no Propably legend among lightboxes, similar to FeatherLightGallery
PhotoSwipe no 32kB (JS)
5kB (CSS)
yes Very nice styled, zoom effect, full screen mode, some limitations, e.g. you need to define image size.

There is almost not bad choice, if talking about lightbox. All do the job well, so it depends more on your specification.

Do you need thumbnails? The setting is available in fancybox plugin.


Fancybox is very popular when jQuery is used. If you need plain JavaScript lightbox plugin, halkaBox is worth to mention. Lightweight, but with many options available.