Updated

Technology · Code & frameworks

Modernizr

modernizr.com

What is Modernizr?

Modernizr is a JavaScript library that detects which HTML, CSS and JavaScript features a visitor's browser supports. It is free, open source software under the MIT license.[1][2][3]

Modernizr is a JavaScript library that detects the availability of next-generation web technologies in users' browsers. It allows developers to test for features rather than specific browser versions, enabling the creation of websites that can adapt to different browser capabilities. Modernizr helps in implementing progressive enhancement and graceful degradation strategies in web development.

Modernizr belongs toJavaScript librariescategory.

What it is

A collection of tests, called detects, that run as a page loads[1]

Method

Feature detection rather than browser sniffing[2]

License

MIT[3]

Custom builds

A download page that builds a version with only the detects you pick[4]

69websites

use it — 2.7% of the 2,539 websites we scanned in the last 12 months

#14of 108

tools in its category seen in our scans (we recognize 253)

8public pages

on UptimeCard — open any of them to see how that site is doing

In short: a feature-detection helper for sites that still serve older browsers; the project's last release came in 2024, so check that the detects you need are still covered.[1][5]

3.34% of all websites we track run Modernizr

What is Modernizr used for?

In short, from the websites we scan

Tailoring the page to the browser
Test results let a page change its behavior to match what the visitor's browser can do.[1]
Serving tiered experiences
Use new browser features where they exist without leaving users of older browsers behind.[1]
Checking browser feature support
Reports which HTML, CSS and JavaScript features the visitor's browser has to offer.[1]
Writing your own detects
The documentation shows how to add a custom test whose result is stored on the Modernizr object.[2]
What it does
Modernizr is one of the javascript libraries tools websites use. In our scans it is #14 of the 108 we see.
Used together with
It is often installed next to Bootstrap, jQuery UI, Facebook Pixel.

Should you use Modernizr?

The 10-second version, from the vendor’s own pages and what we see in our scans

Modernizr fits if…

  • You must support a mix of older and newer browsers and want to branch on real feature support[1]
  • You want a custom build with only the detects you use[4]

Look elsewhere if…

  • You only target browsers that support the features you use and need no fallbacks[1]Modernizr exists to tell you what a browser can do.
The newest release on GitHub dates from 2024, so new browser features may lack a detect[5]

Support and help for Modernizr

How the vendor says you can reach it, and the public help community

Stack Overflow

888 questions[7][8]

73% have an upvoted answer. [modernizr] questions

Modernizr versions

The newest release, the series that still gets fixes, and what changed

Latest release

3.13.1[3][5]

Released 6 Aug 2024

Maintained series

3

What changed in 3.5.0

  • Version 3.5.0 added a detect for CSS Grid, in the standard syntax and the old proposal's syntax[6]

What Modernizr sites add on top

How many of the 69 Modernizr sites we scanned also run each tool, grouped by what the tool does

Tag manager

Google Tag Manager
71%49 sites

Analytics

Google Analytics
67%46 sites
Facebook Pixel
26%18 sites
Microsoft Clarity
15%10 sites

Cookie consent

OneTrust
22%15 sites

Online store

Cart Functionality
19%13 sites

Search visibility

Yoast SEO
19%13 sites

The full bar means every Modernizr site. A site can run several tools for one job, so the shares of tools in one group can add up to more than 100%.

How Modernizr sites protect themselves

Share of the 69 sites we scanned that run each protection

HSTS46% · 32 sites

HTTP Strict Transport Security (HSTS) informs browsers that the site should only be accessed using HTTPS

reCAPTCHA25% · 17 sites

reCAPTCHA is a free service from Google that helps protect websites from spam and abuse

Akamai Bot Manager13% · 9 sites

Akamai Bot Manager detect bots using device fingerprinting bot signatures

Protections add up, they do not replace each other: a site can run all of them.

At a glance

UptimeCard's own scans and tests of 2,539 websites · refreshed weekly

How Modernizr sites scoreout of 100 · hover or tap a score for details

48PerformancePooraverage site: 5187AccessibilityGoodaverage site: 9198Best practicesGoodaverage site: 9692SEOGoodaverage site: 92

Page load time

Loads about 15% slower than the average site

Modernizr sites
4.0 s
All sites
3.5 s

Most Modernizr sites load in 3.3–4.6 s. Home page weight: 3.8 MB vs 3.4 MB for all sites. 8 public sites measured.

Who uses it?

Technology and Software is the biggest group

Technology and Software38%
Educational Resources25%
Automotive13%
Business Services13%

Share of 8 classified public sites. “× average” compares with all 961 public sites.

How Modernizr sites are built

Closest partners. The number says how many times more often the tool runs on Modernizr sites than on an average website. Hover a partner for its share of sites.

Isotope13×Moment.js8×jQuery UI4×Slick4×LazySizes3×Bootstrap3×Google Hosted Libraries3×Font Awesome3×Lodash2×

Stacks we see most. Tools that tend to run together with Modernizr on the same websites. The percentage is the share of all 69 Modernizr sites that run the whole stack.

6 stacks · swipe, drag or use the arrows
#1

Modernizr + Yoast SEO + Contact Form 7 + wpBakery

7.2%5 of 69 sites
#2

Modernizr + OneTrust + Akamai + Boomerang

5.8%4 of 69 sites
#3

Modernizr + jsDelivr + cdnjs

5.8%4 of 69 sites
#4

Modernizr + Google Hosted Libraries + Microsoft ASP.NET

5.8%4 of 69 sites
#5

Modernizr + OneTrust + Varnish

5.8%4 of 69 sites
#6

Modernizr + Yoast SEO + Site Kit

5.8%4 of 69 sites

Websites using Modernizr

69 websites use Modernizr: 2.7% of the 2,539 websites we scanned in the last 12 months. A selection is shown below.

Scores are out of 100: P Performance · A Accessibility · B Best practices · S SEO. Green 80+, yellow 65–79, orange 50–64, red below 50. The dot shows whether our last scan found the site failing (red) or not (green); Red, amber or blue: an active incident on the site's status page (outage, degraded, maintenance) or a failing scan; amber also means a certificate ending within 30 days. Hover the dot for details.

Who is behind Modernizr

From its own pages and public records, with sources

Modernizr

since 2009[9]

Its story

  1. 2009

    The Modernizr repository was created on GitHub, starting the library for detecting browser features.[9]

  2. 2013

    The team announced a complete architectural rewrite of the next major version, converting all of the community feature tests to a new loading structure so custom builds would be easier to make.[10]

  3. 2015

    The next major version was released after almost two and a half years without a release, with a rebuilt site and builder, new detects, and a license change from BSD to MIT.[4]

  4. 2017

    Version 3.5.0 added a detect for CSS Grid in both the standard and legacy syntaxes, so sites could test for grid support.[6]

  5. 2024

    Version 3.13.1 was published and is the newest release on GitHub.[5]

Questions about Modernizr

What is Modernizr?
Modernizr is a JavaScript library that detects which HTML, CSS and JavaScript features a visitor's browser supports. It is free, open source software under the MIT license.
What is Modernizr used for?
Test results let a page change its behavior to match what the visitor's browser can do. Use new browser features where they exist without leaving users of older browsers behind. Reports which HTML, CSS and JavaScript features the visitor's browser has to offer. The documentation shows how to add a custom test whose result is stored on the Modernizr object. Modernizr is one of the javascript libraries tools websites use. In our scans it is #14 of the 108 we see. It is often installed next to Bootstrap, jQuery UI, Facebook Pixel.
What is feature detection?
Feature detection checks programmatically whether a browser supports a feature, instead of guessing from which browser the visitor uses.[2]
How do I read a Modernizr result?
Each test adds a property to the Modernizr object, and you check that property for truthiness.[2]
Which license does Modernizr use?
MIT. The project moved from a BSD license to MIT with its major version rewrite.[4]
Can I create a custom build?
Yes. The site has a builder that creates a build with the detects you choose, and the build system is also available through npm.[4]
How many websites use Modernizr?
We found Modernizr on 69 of the 2,539 websites we scanned in the last 12 months (2.7%). 8 of them have a public status page.
What are the alternatives to Modernizr?
Other javascript libraries tools we recognize include jQuery, core-js, Swiper, jQuery Migrate.

Is your website built with Modernizr?

Create a free status page that shows your visitors your site is up. It also gives your site its own public page where new people can discover it.

Example status page card