The Spring Framework is the core dependency-injection framework and module ecosystem for building Java applications. Spring Boot is an opinionated layer on top of Spring that auto-configures it and removes most of the setup boilerplate. They are not competitors — Spring Boot uses Spring under the hood.
If you are a Java developer comparing the two, that distinction is the whole answer. You are choosing between wiring Spring yourself and letting Spring Boot wire it for you. Everything else in this guide is detail.
This guide reflects Spring Framework 6 / Spring Boot 3, which run on the Jakarta (jakarta.*) namespace and require Java 17 or later. The same comparison holds for older versions, but the package names differ — a point we return to below.
The Short Answer
Spring is the framework; Spring Boot is a fast, opinionated way to use that framework. Spring gives you the IoC container, dependency injection, and a large set of modules (Core, MVC, Data, AOP, Security, Test) that you assemble by hand. Spring Boot keeps all of that and adds auto-configuration, starter dependencies, an embedded web server, and production tooling, so a working application needs almost no manual setup. When you use Spring Boot, you are still using Spring — Boot just makes the common case effortless.
Spring Boot does not replace the Spring Framework — it sits on top and configures it for you.
Bottom line: Spring Boot is not an alternative to the Spring Framework. It is the Spring Framework with the setup work already done.
What Is the Spring Framework
The Spring Framework is, at its core, an inversion-of-control (IoC) container. You declare your objects as beans, describe their dependencies, and Spring constructs and wires the object graph for you through dependency injection. This decouples your classes from the details of how their collaborators are created.
Around that container sits a large module ecosystem. Spring Core provides the container and dependency injection; Spring MVC handles web requests; Spring Data abstracts persistence; Spring AOP applies cross-cutting concerns like transactions; Spring Security covers authentication and authorization; and the Spring Test module supports integration testing. You pull in only the modules you need.
The trade-off is that the framework leaves the assembly to you. You enable component scanning, declare a DataSource, configure Spring MVC, choose and set up a servlet container, and align the versions of every Spring module and third-party library yourself. You also decide details like bean scopes — singleton by default, but request or session scope where it fits. This is powerful and explicit, but it is a lot of plumbing before you write any business logic.
What Is Spring Boot
Spring Boot is the opinionated layer that sits on top of the Spring Framework and makes the plumbing disappear. Its central feature is auto-configuration: Boot inspects your classpath, your existing beans, and your properties, then configures sensible defaults automatically. Add a JDBC driver and Boot configures a DataSource; add the web starter and it configures Spring MVC.
Starter dependencies are the second pillar. A starter such as spring-boot-starter-web is a curated, version-aligned bundle of dependencies, so you declare one artifact instead of hand-picking and aligning a dozen compatible libraries. Boot also ships an embedded server — Tomcat by default — so your application packages as a single runnable JAR with no external server to install.
On top of that, Spring Boot adds production conveniences: Actuator exposes health, metrics, and info endpoints; externalized configuration lets you drive behavior from application.properties or application.yml and environment variables; and @SpringBootApplication ties auto-configuration and component scanning together in a single annotation. The result is that a usable application starts from almost nothing.
Spring vs Spring Boot: Head-to-Head
| Dimension | Spring Framework | Spring Boot |
|---|---|---|
| Configuration | Manual — you declare beans, MVC, data source | Auto-configured from the classpath; override only when needed |
| Dependencies | Pick and align versions yourself | spring-boot-starter-* bundles curated, version-aligned deps |
| Web server | Deploy a WAR to an external server | Embedded server (Tomcat by default); runnable JAR |
| Boilerplate | High — lots of explicit setup | Low — sensible defaults out of the box |
| Production tooling | Add manually | Actuator: health, metrics, info endpoints |
| Learning curve | Steeper — you wire everything | Faster start; the magic still relies on Spring underneath |
| Best for | Fine-grained control, legacy, custom setups | New apps, microservices, fast delivery |
What Spring Boot Adds on Top of Spring
The difference is easiest to see in code. With plain Spring, you declare the moving parts yourself: a configuration class, component scanning, Spring MVC, and a DataSource, plus a servlet container set up or deployed separately. With Spring Boot, a single annotation and the right starter on the classpath do the same work — auto-configuration reads your properties and wires the pieces.
// Plain Spring: you declare the pieces yourself (simplified)
@Configuration
@EnableWebMvc
@ComponentScan("com.example")
public class WebConfig {
@Bean
public DataSource dataSource() { /* driver, URL, pool... */ }
// + servlet container configured/deployed separately
}// Spring Boot: one annotation + a starter on the classpath
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
// spring-boot-starter-web pulls in MVC + an embedded Tomcat,
// and auto-configuration wires the DataSource from your properties.Both applications produce the same Spring beans at runtime. The second one just delegates the wiring decisions to Boot's defaults, which you can still override whenever you need to.
Version note: This guide reflects Spring Boot 3 (built on Spring Framework 6), which moved from the
javax.*to thejakarta.*namespace and requires Java 17+. Spring Boot 2.x (Spring 5.3) still usesjavax.*. If a tutorial mixes the two, that is why imports won't resolve.
When to Use Spring vs Spring Boot
For most work in 2026, the practical default is straightforward: reach for Spring Boot. It gets a new service running quickly, and you can override any default the moment you need something specific.
- New projects, microservices, fast delivery → Spring Boot. Auto-configuration, starters, and the embedded server remove the setup tax, and nothing stops you from customizing later.
- You still must understand plain Spring. Boot only configures Spring for you. When auto-configuration does something surprising, you debug it as Spring beans, conditions, and context — so knowing the underlying framework is not optional.
- Reasons to use Spring without Boot: an existing application that already has a hand-tuned configuration, a deployment target that mandates a WAR on a specific application server, or a setup so non-standard that Boot's opinions get in your way more than they help.
In short, choose Boot for new code and choose plain Spring only when a concrete constraint forces it.
Is Spring Boot Replacing Spring?
No. Spring Boot is not a replacement for the Spring Framework — it is a layer built directly on top of it. Every Spring Boot application depends on Spring: the IoC container, dependency injection, MVC, and the rest of the modules all come from the framework itself.
The version coupling makes this explicit. Spring Boot 3 is built on Spring Framework 6, and Spring Boot 2.x is built on Spring 5.3. When you upgrade Boot, you are upgrading the Spring version underneath it. You are always using Spring when you use Boot; Boot simply decides the defaults.
Remember: If a question frames Spring and Spring Boot as competing choices, that is the trap. Boot is a layer on top of Spring, so every Spring Boot app is a Spring app.
Spring vs Spring Boot for Interviews and the Exam
"What's the difference between Spring and Spring Boot?" is one of the most common screening questions in Java interviews, precisely because a clear answer signals you understand the layering rather than just memorizing annotations. Be ready to say it in one sentence and then expand with auto-configuration, starters, and the embedded server. For more practice in this format, see our Spring Boot interview questions and the broader Spring interview questions.
The same distinction matters for certification. The 2V0-72.22 exam tests core Spring concepts and Spring Boot together, so you need both the container fundamentals and Boot's conventions. For a structured study path, follow our Spring Professional preparation guide, and try a few free practice questions to see where the gaps are.
Frequently Asked Questions
Is Spring Boot the same as Spring?
No. Spring Boot is not the same as Spring — it is a convenience layer built on top of the Spring Framework. Boot adds auto-configuration, starters, and an embedded server, but the dependency injection and modules underneath are pure Spring.
Do I need to learn Spring before Spring Boot?
You do not strictly need to, but you should. Spring Boot only auto-configures Spring for you, so understanding the Spring Framework is what makes Boot's "magic" debuggable when a default behaves unexpectedly.
Is Spring Boot replacing the Spring Framework?
No. Spring Boot depends on the Spring Framework rather than replacing it — Spring Boot 3 runs on Spring Framework 6. Upgrading Boot upgrades the Spring version it sits on.
Can you use Spring without Spring Boot?
Yes. The Spring Framework works perfectly well standalone; you simply configure beans, MVC, and your data source by hand. Spring Boot is an optional convenience, not a requirement.
Is "difference between Spring and Spring Boot" a common interview question?
Yes. The difference between Spring and Spring Boot is a standard screening question in Java interviews. See our Spring Boot interview questions and Spring interview questions to practice answering it.
Next Steps
Spring is the framework; Spring Boot is the opinionated layer that auto-configures it for you — and you are always using Spring whenever you use Boot. To go further, try the free practice questions, drill the Spring Boot interview questions, go deeper on how Spring Boot auto-configuration works, or plan your study with the Spring Professional preparation guide.