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 · 2 min read


The C4 model is a simple way of drawing software architecture at four levels of detail: context, containers, components and code, the four Cs that give it its name. It works like a map that you can view at the level of a country, a city, a street and a building. Each level zooms in on the one above it. The approach was created by Simon Brown, a software architect and author, and is widely used by development teams because it is easy to learn and does not require a special notation.

What are the four levels of the C4 model?

LevelShowsAudience
1. System contextThe system as a box, the people who use it and the other systems it interacts withEveryone, including non-technical stakeholders
2. ContainersThe deployable or runnable parts of the system, such as web apps, APIs, databases and queues, and how they communicateTechnical people, architects and operations
3. ComponentsThe main building blocks inside one container and their responsibilitiesDevelopers and architects
4. CodeClasses or code structure for one componentDevelopers, usually generated by tools if needed at all

Note that "container" in C4 means any separately runnable or deployable unit, not specifically a Docker container. Most teams draw levels 1 and 2 for every system, level 3 where useful and level 4 rarely.

Supplementary diagrams

  • System landscape: several systems and how they relate.
  • Dynamic: how elements collaborate for a specific scenario.
  • Deployment: how containers map to infrastructure.

Benefits of the C4 model

  • Simple: boxes and lines with clear labels, readable without training.
  • Consistent: a common set of abstractions across teams.
  • Zoomable: each audience sees the level of detail it needs.
  • Tool-friendly: supported by "diagrams as code" tools such as Structurizr and PlantUML, so diagrams can be kept in version control alongside code.

C4 vs. ArchiMate

C4 focuses on software systems and is designed for development teams. ArchiMate covers the whole enterprise, linking business, application and technology layers, with a much richer formal vocabulary. Many organizations use ArchiMate for enterprise views and C4 for individual systems.

C4 model example

Consider a hypothetical team onboarding three new engineers to a payments platform whose only documentation is a single complex diagram nobody fully understands. The tech lead draws a C4 context diagram showing the platform, its users and the five external systems it connects to, then a container diagram showing its web app, three APIs, two databases and a message queue. New engineers say they understand the system's shape in their first day, and the diagrams, stored as code in the repository, are updated in the same pull requests as the changes they describe.

The C4 model is one approach to drawing an architecture diagram and is often used to describe system architecture.

Frequently asked questions

What does container mean in the C4 model?

In the C4 model, a container is any separately runnable or deployable part of a system, such as a web app, an API, a database or a message queue. It does not specifically mean a Docker container. Container diagrams, the second level of C4, show these parts and how they communicate, mainly for technical people, architects and operations.

Which C4 model diagrams should a team draw?

Most teams draw C4 levels 1 and 2, the system context and container diagrams, for every system. Level 3 component diagrams are added where they help, and level 4 code diagrams are rarely drawn, usually generated by tools if needed at all. Supplementary diagrams show how several systems relate, how elements collaborate in a scenario and how containers map to infrastructure.

What is the difference between the C4 model and ArchiMate?

The C4 model focuses on software systems and is designed for development teams, using simple labeled boxes and lines that need no training. ArchiMate covers the whole enterprise, linking business, application and technology layers with a much richer formal vocabulary. Many organizations use ArchiMate for enterprise views and C4 for individual systems.