Moment.js
Moment.js is a free and open-source JavaScript library that removes the need to use the native JavaScript Date object directly.
Websites Using Moment.js
What Is Moment.js?
Moment.js is a JavaScript library for parsing, validating, manipulating, displaying, and formatting dates and times. The direct answer to the most common question is that Moment.js was, for many years, the default date-handling library on the web, used so universally that it became almost synonymous with date work in JavaScript. The equally important second half of that answer is that Moment.js is now in maintenance mode: its own maintainers officially consider it a legacy project and, on the project's website, recommend modern alternatives for new development. It is not abandoned or insecure, but it is no longer actively developed with new features.
Moment.js is published on npm as moment and is reported across the registry to still draw enormous download numbers, on the order of many millions per week, because it remains baked into a vast number of existing applications and dependencies. Because precise figures vary by source and the library's role is shifting, the accurate framing is qualitative: Moment.js is one of the most-installed JavaScript packages in history and remains extremely common on the existing web, even as the project itself steers new projects elsewhere. The project's maintainers state plainly that they consider Moment.js a legacy project in maintenance mode and discourage starting new work with it; this is documented on the official Moment.js site. Treat any single hard market-share percentage you see quoted in isolation with caution.
For technology profiling, detecting Moment.js is informative on two fronts. First, it confirms a site does meaningful date and time formatting, common in dashboards, scheduling tools, and content with timestamps. Second, because the library is now legacy, its presence is a useful signal about a codebase's age and maintenance posture, since many teams are actively migrating away from it.
How Moment.js Works
Moment.js centers on a wrapper object. You call moment() to create a Moment instance representing a point in time, and that object carries a rich set of methods for transforming and displaying it. The design is deliberately fluent and chainable, which is a large part of why it became so popular.
The typical patterns look like this in spirit: you create a moment from the current time, from a string, from a timestamp, or from individual date parts; you manipulate it by adding or subtracting durations; and you format it into a human-readable string or a relative phrase. The library handles the messy realities of dates, parsing many input formats, validating them, and rendering output according to format tokens.
A few mechanics define how Moment.js behaves and how you detect it:
- The global
momentobject. When loaded via a script tag, Moment.js attaches a globalmomentfunction (window.moment). Calling it returns a Moment instance, and the function itself carries helper methods and properties. - Version property. The library exposes its version as
moment.version, which is the cleanest version marker. - Mutability. A defining and often-criticized trait is that Moment objects are mutable. Methods like
addandsubtractchange the original object in place rather than returning a new one, which has historically caused subtle bugs and is one reason the maintainers point to immutable alternatives. - Formatting tokens. Output is controlled by format strings using tokens (such as those for year, month, day, hour, and minute). Relative-time formatting produces phrases like a friendly fromNow output.
- Locales. Moment.js supports internationalization through locale files. Many sites load additional locale scripts (for example a
localesorlocaledirectory, ormoment-with-locales.min.js) to format dates in non-English languages. These locale files are themselves a detection signal. - Companion packages. Time zone support is provided by a separate
moment-timezonepackage, which is large because it bundles the IANA time zone database. Seeing Moment Timezone alongside Moment is common.
Because Moment.js is large by modern standards, especially with locales and time zone data, bundle size is a frequent complaint and another reason newer projects choose smaller alternatives. When bundled, the readable moment name can disappear, though locale files and the global often remain visible.
How to Tell if a Website Uses Moment.js
Moment.js leaves fairly clear fingerprints, especially when loaded from a CDN or accompanied by locale files.
Signals in the page and network
- CDN script paths. Look for requests to
moment.min.js,moment.js, ormoment-with-locales.min.jsfrom hosts such ascdn.jsdelivr.net/npm/moment,unpkg.com/moment, orcdnjs.cloudflare.com/ajax/libs/moment.js. The path frequently includes a version, for examplemoment.js/2.29.4/moment.min.js, which is a precise version marker. A companionmoment-timezone-with-data.min.jsrequest indicates Moment Timezone. - Locale files. Requests for individual locale scripts, often under a
locale/orlocales/path (for examplelocale/fr.js), strongly suggest Moment.js, since loading per-language locale bundles is a hallmark of the library. - The global
momentobject. When loaded via a script tag, Moment.js attacheswindow.moment. Typingmomentin the DevTools Console and seeing a function that returns a date object with formatting methods is a direct confirmation. - Version marker. If the global exists,
moment.versionprints the exact release. This is the most reliable way to determine which version a site runs and how old it is. - Bundled source strings. When Moment.js is compiled into an application bundle, searching the minified source for distinctive format-token handling and identifiers can reveal it, though this is less reliable than a CDN reference.
Tools to confirm it
| Tool | What you do | What it reveals |
|---|---|---|
| View Source | Open the page HTML source | Script tags pointing to moment.min.js or moment-with-locales.min.js with a version in the path |
| DevTools Console | Type window.moment then moment.version | Confirms the global function and prints the exact version |
| DevTools Network | Filter by JS and reload | Requests for the Moment file plus any locale/ or moment-timezone scripts |
| DevTools Sources | Browse loaded scripts | Locale bundles and time zone data files that accompany Moment |
| Wappalyzer | Run the browser extension on the page | Flags Moment.js in the JavaScript libraries category |
When Moment.js is fully bundled with no CDN reference, no locale files, and the global scoped away, external detection becomes harder, and the safest conclusion is that the site performs date formatting in a manner consistent with Moment. For a broader walkthrough, see our guides on how to check what JavaScript libraries a website uses and how to find out what technology a website uses.
Key Features
Moment.js became popular by making date work approachable, and its feature set is broad.
- Flexible parsing. Reads dates from strings, timestamps, arrays, and individual components, with format hints.
- Rich formatting. Token-based output for virtually any date and time display, plus relative phrases like a fromNow style.
- Manipulation. Add and subtract durations, set and get individual units, and find start or end of a period.
- Validation. Checks whether an input is a valid date and reports why if not.
- Internationalization. Locale files for many languages, controlling month names, weekdays, and formats.
- Time zone support. Through the separate Moment Timezone package backed by the IANA database.
- Durations and difference. Compute and format the span between two times.
- Chainable, fluent API. Methods return the object for readable chained calls.
A few features explain both its dominance and its decline. The fluent, chainable API made dates feel easy, which drove adoption across tutorials, frameworks, and Stack Overflow answers for a decade. The locale and time zone support made it the obvious choice for international applications, though those same features ballooned the bundle. And the mutability of Moment objects, while convenient in simple cases, became a notorious source of bugs in larger codebases, directly motivating the immutable design of successor libraries.
Pros and Cons
Moment.js is battle-tested and feature-complete, but its legacy status and size are real drawbacks for new work.
Pros
- Extremely capable and mature, covering nearly every date and time need.
- Familiar, readable API with abundant documentation and community examples.
- Strong internationalization and, with Moment Timezone, robust time zone handling.
- Reliable and stable, with no churn since it entered maintenance mode.
- Massive existing knowledge base, so problems are usually well-documented.
Cons
- Officially in maintenance mode; the maintainers recommend modern alternatives for new projects.
- Large bundle size, especially with locales and time zone data, which hurts performance.
- Mutable objects can cause subtle, hard-to-trace bugs.
- Not tree-shakeable in the way modern modular libraries are, so unused code is hard to drop.
- New features are not being added, so it will not adopt newer platform date APIs.
Moment.js vs Alternatives
Moment.js is most usefully compared with the modern, smaller, immutable libraries that have largely succeeded it, and with the emerging native platform API. The right choice depends on whether you are maintaining existing code or starting fresh.
| Library | Status | Size | Immutable | Tree-shakeable | Best for |
|---|---|---|---|---|---|
| Moment.js | Legacy / maintenance | Large | No | No | Existing codebases already using it |
| date-fns | Active | Small (modular) | Yes | Yes | Functional, tree-shakeable date utilities |
| Day.js | Active | Very small | Yes | Partial | A Moment-like API with a tiny footprint |
| Luxon | Active | Medium | Yes | Partial | Time zones and i18n with a modern design |
| Temporal (native) | Emerging standard | Built-in | Yes | N/A | Future-proof native date and time handling |
The most instructive comparison is Moment.js versus its modern successors. Day.js is frequently chosen for migrations because it deliberately mirrors Moment's API while being a fraction of the size and immutable, so existing Moment code often ports with minimal changes. date-fns takes a different, functional approach: you import only the specific functions you use, which keeps bundles tiny and tree-shakeable. Luxon, written by a Moment maintainer, offers a modern, immutable design with strong time zone and internationalization support. Looking further ahead, the Temporal API is being standardized into JavaScript itself and aims to make date libraries largely unnecessary for new code. The practical takeaway: keep Moment where it already works, but reach for Day.js, date-fns, or Luxon when starting something new.
For another widely encountered legacy-era library you may find alongside Moment on older sites, see our profile of jQuery.
Use Cases
Moment.js appears across a recognizable set of scenarios, and recognizing it helps explain a site's behavior and age.
- Dashboards and analytics. Formatting timestamps, date ranges, and relative times like a few minutes ago.
- Scheduling and booking tools. Manipulating dates, computing durations, and validating user-entered dates.
- Content with timestamps. Blogs, comment systems, and feeds that show friendly relative dates.
- Internationalized applications. Sites that load Moment locale files to display dates in multiple languages.
- Time zone aware apps. Calendars and event tools that pair Moment with Moment Timezone.
- Legacy applications under maintenance. Older codebases that adopted Moment years ago and have not yet migrated.
For competitive research and lead generation, spotting Moment.js, especially an older version or one with many locale files, is a meaningful maturity and age signal, since many teams are actively replacing it as part of modernization efforts.
Frequently Asked Questions
Is Moment.js deprecated or dead?
Not exactly dead, but officially legacy. The Moment.js maintainers have placed the project in maintenance mode and, on the official Moment.js website, recommend modern alternatives for new development. That means Moment.js still works, still receives critical maintenance, and remains safe to use in existing projects, but no new features are being added. For new work, the project itself points developers toward smaller, immutable libraries or the emerging native Temporal API.
How can I tell which version of Moment.js a site uses?
If Moment.js is loaded via a script tag or CDN, open the DevTools Console and type moment.version, which prints the exact release string. You can also read the version directly from the CDN path in the page source, for example moment.js/2.29.4/moment.min.js. The version is a useful age signal, and seeing accompanying locale files or a Moment Timezone bundle tells you how the site uses the library.
Why are people moving away from Moment.js?
Three main reasons. First, its bundle size is large by modern standards, especially once locales and time zone data are included, which hurts page performance. Second, Moment objects are mutable, a design that causes subtle bugs and runs counter to current best practices. Third, the project is in maintenance mode, so it will not adopt newer platform capabilities. Smaller, immutable, tree-shakeable libraries like Day.js, date-fns, and Luxon address these issues, and the native Temporal API aims to reduce the need for a library at all.
What should I use instead of Moment.js for a new project?
It depends on your needs. Day.js is a popular choice because it closely mirrors Moment's API while being far smaller and immutable, making migrations easy. date-fns suits teams that prefer a functional, import-only approach with excellent tree-shaking. Luxon offers a modern design with strong time zone and internationalization support. And for future-proofing, the standardized Temporal API is on track to be built into JavaScript. The Moment.js project itself recommends considering these alternatives for new development.
Is it safe to keep using Moment.js on an existing site?
Generally yes. Maintenance mode means the library is stable and still receives critical fixes, so existing applications that rely on it can continue to do so without urgency. The main considerations are bundle size and the lack of new features rather than safety. Many teams plan a gradual migration, often to Day.js because of its similar API, but there is no need to rip out a working Moment.js integration overnight.
Want to identify the JavaScript libraries, frameworks, and full stack behind any website instantly? Try StackOptic at https://stackoptic.com.
Alternatives to Moment.js
Compare Moment.js
Analyze a Website
Check if any website uses Moment.js and discover its full technology stack.
Analyze Now