C4 Model

What is the C4 model?

The C4 model is a lightweight approach to diagramming software architecture that describes a system at four levels of detail: context, containers, components and code.

Updated November 2026 · 5 min read


The C4 model gives teams a simple, consistent way to draw software architecture. Instead of a single complex diagram, it describes a system through a set of zoom levels, similar to a map that can show a country, a city, a street and a building. The highest level shows the system and the people and systems around it. Each lower level zooms into part of the picture, adding detail for audiences who need it.

The model was created by software architect Simon Brown and has become popular because it is easy to learn and does not require specialized notation or tools. It is widely taught and used by development teams of all sizes. It focuses on clear abstractions and good diagram practice rather than on symbols. For enterprise architecture and IT strategy, the C4 model helps teams document systems in a way that both technical and non-technical stakeholders can understand, which improves communication about design choices, dependencies and change.

Definition of the C4 Model

The C4 model is a hierarchical set of software architecture diagrams based on four abstractions: software systems, containers, components and code. Each diagram type shows one level of this hierarchy for a specific audience.

It is often used alongside or instead of formal notations such as ArchiMate and UML, particularly for solution architecture and software design. It is one of the most widely used approaches for producing an architecture diagram of a software system.

The Four Levels

The system context diagram shows the software system being described, the people who use it and the other systems it interacts with. It contains no internal detail and suits any audience.

The container diagram zooms into the system to show its main deployable or runnable parts, such as web applications, mobile apps, APIs, databases and message queues, and how they communicate. In C4, "container" means any separately running unit, not only software containers.

The component diagram zooms into one container to show its major internal components and their responsibilities. It is mainly useful for developers and architects working on that container.

The code diagram zooms into a component to show its classes or functions. This level is optional and often generated by development tools when needed.

Supplementary Diagrams

System-wide diagrams show how several software systems relate across an organization, extending the context view to a wider scope.

Dynamic diagrams show how elements collaborate at runtime for a particular scenario, such as processing an order. They help explain sequences that static diagrams cannot show.

Deployment diagrams show how containers map to infrastructure, such as cloud services, servers and environments.

Importance of the C4 Model in Enterprise Architecture

The C4 model improves communication. Its zoom levels let architects show executives a simple context view while giving developers the detail they need, all within one consistent set of diagrams.

It is easy to adopt. Teams can start using it with any drawing tool and little training, which encourages documentation that might otherwise not be produced. Low barriers to entry matter, since documentation that is hard to produce is rarely kept up to date.

It also encourages consistency. When teams across an organization use the same levels and conventions, their diagrams can be compared and combined. Enterprise architects can then assemble a broader picture from many teams' diagrams.

Supporting Better Decisions

Context and container diagrams make dependencies visible, which helps assess the impact and cost of changes, such as replacing a database or retiring an integration.

System-wide diagrams give enterprise architects a view of how systems fit together across the organization, complementing the application inventory.

Clear diagrams also shorten onboarding for new team members and vendors, reducing the time and cost of knowledge transfer. They also help auditors and security reviewers understand systems without lengthy interviews.

When diagrams are kept with the code or generated from models, they stay closer to reality, which makes them more reliable for planning.

Limitations

The C4 model focuses on software systems. It does not cover business capabilities, value streams or organizational structures, which enterprise architects typically model with other approaches. Many organizations combine C4 for software with a capability map and other models for the business view of enterprise architecture.

It provides guidance on abstractions and diagram practice but leaves notation open, so organizations need their own conventions for colors, shapes and labels. Without conventions, diagrams from different teams can still look and read very differently.

Like any diagramming approach, it requires discipline to keep diagrams up to date as systems change.

How to Use the C4 Model

Using the C4 model involves agreeing conventions, starting with context and container diagrams, adding detail where it helps and keeping diagrams current.

Most teams find that the first two levels deliver most of the value.

Getting Started

Agree organization-wide conventions, such as shapes, colors, labeling and the use of legends, and publish a template. Include one or two complete examples so teams can see the expected level of detail.

Create a system context diagram for each significant system, showing users and external systems. These diagrams are quick to produce and often reveal dependencies that were not documented.

Create container diagrams for systems that are complex, critical or changing, showing the main runnable parts and how they communicate, including technologies and protocols.

Maintaining and Extending

Add component diagrams only where they help, such as for complex containers or areas under active development. Detailed diagrams that nobody maintains soon become misleading.

Store diagrams with the system's code or documentation, or generate them from models using diagram-as-code tools, so they are easy to update.

Use system-wide diagrams to connect individual systems into a wider view for enterprise architecture, and review diagrams during design reviews and major changes.

Examples of the C4 Model in Enterprise Architecture

The examples below show the C4 model in practice.

Both use illustrative figures. The first standardizes documentation across teams, and the second supports an impact assessment.

In each, consistent levels of detail made systems easier to understand.

Standardizing Documentation

A software company's 40 teams each document their systems differently, and architecture reviews spend much of their time clarifying diagrams.

The company adopts the C4 model with shared conventions and asks each team to produce context and container diagrams for its systems.

Within six months, 35 teams have current diagrams, and the average architecture review takes about half as long because reviewers can understand designs quickly.

Supporting an Impact Assessment

An insurer plans to replace its document generation service. Container diagrams for related systems show that seven applications call the service directly.

The diagrams also reveal that two of those applications pass documents to a regulatory reporting system, which had not been included in the project scope.

The project adds the reporting system to its testing plan, avoiding a compliance failure at go-live.

Conclusion

The C4 model is a lightweight approach to diagramming software architecture at four levels: context, containers, components and code. Supplementary diagrams cover system-wide views, runtime behavior and deployment.

In enterprise architecture, the C4 model improves communication, is easy to adopt and encourages consistent documentation that supports impact analysis and planning. Agreeing conventions, starting with context and container diagrams, adding detail only where useful and keeping diagrams close to the code or models help teams get lasting value from it.