Side by side
MVCvsMVVM
What is the difference between MVC and MVVM?
Updated 2 min read6 differences
In short
MVC splits an app into a model, a view and a controller that handles input, while MVVM puts a ViewModel between model and view and syncs them by data binding.
MVC
Model–View–Controller
MVC is an architectural pattern that splits an application into a Model for data and logic, a View for display, and a Controller that handles user input.
Read the page on MVCMVVM
Model-View-ViewModel
MVVM (Model-View-ViewModel) is a UI pattern where a ViewModel holds a screen's state and actions and the View binds to it, so the UI follows state changes.
Read the page on MVVMMVC and MVVM compared
| Aspect | MVC | MVVM |
|---|---|---|
| Middle layer | Controller | ViewModel |
| How the view updates | The controller picks and renders a view | Data binding updates it automatically |
| Origin | Smalltalk, 1979 | Microsoft WPF, 2005 |
| Typical environment | Server-side web frameworks | Desktop, mobile and reactive front ends |
| Testing | Controllers tested with request fakes | ViewModels tested without any UI |
| Examples | Rails, Django, Laravel, Spring MVC | WPF, .NET MAUI, Android Jetpack, Vue |
The difference, explained
Both patterns separate data and business logic, the model, from what the user sees, the view. In MVC, which dates back to Smalltalk in 1979, a controller receives user input, updates the model and selects a view to render. On the web, frameworks such as Rails, Django, Laravel and Spring MVC follow it: a request goes to a controller action, which loads data and renders a template.
MVVM, introduced at Microsoft in 2005 for WPF, replaces the controller with a ViewModel: an object that exposes the state and commands one screen needs, such as isLoading, items and refresh. The view binds to it declaratively, so when the ViewModel changes, the view updates by itself, and user input flows back through bindings.
That makes MVVM a natural fit for rich client apps with long-lived screens: desktop apps in WPF, mobile apps with Android's Jetpack ViewModel or SwiftUI, and reactive front-end frameworks. The ViewModel can be unit tested without any UI. MVC fits request-response server applications, where each request is handled and then forgotten.
A common misconception is that one pattern replaced the other. They solve similar separation problems in different environments, and many modern stacks mix ideas: a server can use MVC while its interactive front end uses components or ViewModels with data binding.
Which one should you use?
Choose MVC when…
- You build a server-rendered web application.
- Each request is handled independently and then finished.
- Your framework, such as Rails or Laravel, is built on it.
Choose MVVM when…
- You build a desktop or mobile app with long-lived screens.
- Your UI framework supports data binding.
- You want screen logic testable without the UI.
Readers ask
Is MVVM better than MVC?
Not in general. MVVM suits rich clients with data binding; MVC suits server-side request handling. The right choice depends on the platform.
Is React MVC or MVVM?
Neither strictly. React components combine view and state with one-way data flow, though hooks or stores that hold screen state play a role similar to a ViewModel.
What is MVP?
Model-View-Presenter, another variant where a presenter updates a passive view explicitly instead of through data binding. It was common in older Android and Windows Forms apps.