Skip to content
Getting Digital

Framework (vs Library)

Also: software framework, web framework, front-end framework, JavaScript framework, library, framework vs library

A framework is a body of code that imposes a structure on the application built with it: it decides how files are organised, when the application's own code is called and how its parts talk, whereas a library is code the application calls when it chooses.

Assessment. The appropriate framework is usually the one the team already knows, followed by the one with the largest community and the most documented solutions, because the costs of a framework are paid over years in hiring, upgrades and support. A site with a few static pages needs no framework; adding one in that situation is a common beginner error.

MDN's description fits every framework on either side of the stack: a library that offers opinions about how software gets built. The conventions are the purpose. A library such as a date formatter sits still until the application calls it; a framework such as React, Angular, Vue or Django calls the application, deciding when a component renders, when a request reaches a view and where the configuration lives. That inversion is what makes a framework productive on day one, because the hundred decisions a project needs have been made, and what makes it costly years later, because the decisions cannot be reversed without migrating away.

On the browser side the four MDN names date from a short period: Ember in 2011, React in 2013, Vue in 2014, Angular in its current form in 2016. They solve one problem, keeping what the user sees in step with the data as it changes, and they solve it with components, small units of markup, style and behaviour that compose into a page. On the server side the frameworks are older and settle a different set of questions: how a URL maps to code, how a database table becomes an object, how a session is kept and how a form is validated. Django, Rails, Spring, Laravel and Express are the usual answers in their languages, and a full-stack developer typically runs one of each.

QuestionLibraryFramework
Who calls whomThe application calls the libraryThe framework calls the application
StructureNone imposedFiles, naming and lifecycle are prescribed
Replacing itSwap one function for anotherA rewrite of everything that follows its conventions
ExamplesA date formatter, an HTTP client, a chart drawerReact, Angular, Vue, Django, Rails, Spring, Laravel

MDN's own guidance on when to omit one applies: a personal portfolio with a few pages and little interaction does not need a framework or its JavaScript. The decision rule for the rest is interaction and lifespan. A page that changes as the user works, a dashboard, an editor, a shop basket, pays for a front-end framework quickly; a page that is read and left does not. On the server, almost any application that lasts past a prototype benefits from a framework's handling of security, sessions and database access, which are exactly the parts a hand-rolled server gets wrong. The web development courses teach one of the big four after plain JavaScript, and the freeCodeCamp Front End Development Libraries certification is graded on projects built in React.

In practice

A team rebuilds a four-page marketing site in a front-end framework because the developer wanted to learn it. The site now ships a bundle of scripts to render text that was static, loads slower than the version it replaced, and breaks for a visitor with JavaScript blocked. The same team's customer dashboard, with filters, live totals and an inline editor, is where the framework belonged, and where the same developer later used it well.

Often confused with

Full-Stack Development
Full-stack development is the ability to build both the browser side and the server side; a framework is a tool used on one of those sides. A developer can be full stack with any frameworks or none.
Web Template
A web template is a finished design to fill with content; a framework is a code structure to build an application in. A template may be built with a framework, and a framework ships with no design at all.

Key takeaways

  • →The application calls a library; a framework calls the application. The second is what imposes structure.
  • →Front-end frameworks keep the page in step with changing data; server frameworks settle routing, data access and security.
  • →A few static pages need no framework. Interaction and lifespan are the reasons to add one.

Related concepts

Where this concept sits in the field

Certifications that test this

Vendor exams whose syllabus covers this concept: facts, cost and a preparation path on each page.

FAQ

Which front-end framework should a beginner learn first?
The one the job market near them asks for, which in most markets is React, and only after plain HTML, CSS and JavaScript are comfortable. Learning a framework before the language it is built on produces developers who cannot debug the framework when it misbehaves.
Is a framework the same as a library like jQuery?
No. jQuery is a library: the page calls it to find elements and change them, and the page keeps its own structure. React decides when components render and how state flows; that control over the application is what makes it a framework in practice, whatever its own documentation calls it.
Do frameworks go out of date?
The popular ones have lasted a decade or more and change by versions rather than replacement. The risk is a major upgrade that touches every file, which is why the stance above prefers the framework the team knows and the community has documented.

Sources

The primary text this definition rests on. Read it before relying on this one.

Last reviewed 3 October 2026 · Getting Digital