Created by Simon Brown, who first presented it in a workshop at QCon London in March 2010, used the name C4 by his 2011 workshop there, and describes it on c4model.com.
Describes a software system through four nested diagrams, system context, containers, components, and code, each zooming one level closer, so people with different needs can share one map of how the software is built.
Eight questions about an insurer's customer portal, each answered at one level of the C4 model
The C4 model describes a system as four nested maps. Select a question, then the diagram that answers it: its box lights and says who the diagram is for. Show the sort to compare yours. Illustrative.
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
- Not placedPlacedSystem contextContainerComponentCode
Questions
Diagram level
Your sort matched 0 of 8.Your sort matched 1 of 8.Your sort matched 2 of 8.Your sort matched 3 of 8.Your sort matched 4 of 8.Your sort matched 5 of 8.Your sort matched 6 of 8.Your sort matched 7 of 8.Your sort matched 8 of 8.
- System context
- The portal as one box, with the people and outside systems around it. Simple enough for any stakeholder, technical or not.
- Container
- The applications and data stores inside the portal. For the people who build, run, and secure it.
- Component
- The parts inside one application, such as the claims service. For the engineers who work on it.
- Code
- How one component is implemented, in classes or functions. For the developer changing that code.
The sort
- Who uses the portal?: System context. Customers, brokers, and the payment provider appear around one box, a view anyone can read.
- Which systems does it call?: System context. External systems appear as boxes around the portal, without technical detail.
- Where are policies stored?: Container. Data stores are containers, and they appear on this diagram.
- Which apps make it up?: Container. Applications and data stores are the containers inside the system.
- What is inside claims?: Component. The parts of one container are its components.
- What sends the emails?: Component. A unit inside a container, so a component diagram answers it.
- How is a discount computed?: Code. An implementation detail, shown at the code level.
- Which class holds the rules?: Code. Classes and functions are code elements, the lowest level.
An example
A retail insurer had a customer portal that nobody could draw. Each team's diagram used its own symbols, and new engineers took a month to learn where anything lived. The architecture lead asked for one picture per level. The first showed the portal in the middle, with customers, brokers, and the payment provider around it. Anyone in the company could read it, including the compliance officer.
The second zoomed into the portal and showed its web application, its mobile back end, and the database that held policies. When the risk team asked where customer records were stored, they found the answer in under a minute, and discovered that a reporting job copied them to a second database that nobody had listed. The third and fourth levels, drawn only for the claims component, helped the engineers who worked on it. The month of onboarding became a week, and the second database was brought under the same controls.
The core idea
The C4 model draws a software system at four levels of zoom, each a separate diagram for a different reader. The system context diagram puts the system in one box, with the people who use it and the outside systems it depends on around it, and no technology at all. The container diagram opens that box to show the applications and data stores inside, the view the people who build and run the system need. The component diagram opens one container, and the code diagram, which teams draw only where it pays, opens one component.
The logic is a map's: a reader zooms in only as far as the question requires. Each level is built from a few named abstractions, a person, a software system, a container, a component, so a box means the same thing on every diagram, and the top level stays simple enough for a stakeholder who has never seen code. The model prescribes no notation or tool, and supporting views of the wider landscape, runtime behavior, and deployment sit beside the four.
The thinking behind it
Simon Brown Simon Brown developed C4 in the architecture workshops he ran from the mid-2000s, where groups designing a system kept producing diagrams that hardly anyone, Brown included, could read. UML, the standard notation, was falling out of use, and his audiences had no wish to learn it, so he taught plain boxes and lines drawn at a few set levels of detail. He first ran the approach at QCon London in March 2010, likening the diagrams to camera lenses from wide angle to macro, and a talk about a week later named four levels: systems, containers, components, and classes. The name C4 appears by his 2011 workshop, and the last level became Code in 2018.
Where it sits in the layers
The C4 model sits in Layer 9, Tools and Techniques: a notation for drawing software at four levels of zoom, which a team can pick up inside whatever method it runs. From above it takes the observation of Conway's Law in Layer 5 that a system's structure and its builders' structure shadow each other, and the view of Sociotechnical Systems in Layer 6 that the two should be designed together. It serves Layer 8 methods: Domain-Driven Design decides where the boundaries go, and C4 draws them. Below it, the diagrams are put to work in design reviews and in a new engineer's first week. The common mistake is to ask C4 to decide the architecture. It records and communicates a design, and choosing a good one is a method's job.
How organizations put it to work
An engineering organization adopts C4 through its architects or a platform group, often with a few trained advocates in each team. Its site names the uses: communication, onboarding, architecture reviews, finding risks, and threat modeling. Ownership of each diagram sits with the team that owns the system it describes, and a central group keeps the shared conventions and the landscape view.
The change is in routines. A new system or a significant change comes to design review with the context and container diagrams, and teams update them when the system changes, as part of the work. Measures are simple: the share of systems with a current context and container diagram, and the time a new engineer takes to find where something lives.
Sustaining it takes diagrams kept near the code and reviewed with it, since stale pictures mislead, and leaders who ask for them. In the first year a leader should expect a surge of drawing followed by drift, some argument over where one level ends and the next begins, and quick wins in onboarding and in risk reviews. The business depends less on the few people who carry the whole system in their heads.
Where it goes wrong
The first failure is drawing everything. Teams produce all four levels for every system, nobody keeps them current, and the pictures go stale. The sign is a diagram that no longer matches the system and that people have stopped consulting.
The second is mixing levels. A box that is a container in one place and a component in another makes a diagram confusing, and the benefit of a shared map disappears. The sign is a diagram that needs its author in the room to explain it.
The third is the picture as a substitute for thinking. A neat diagram can describe a poor design, and review may confuse tidiness with soundness. The sign is a review that discusses the notation and skips the structure.
A further limit is scope. C4 describes software structure. It says nothing about the business process, the strategy, or the data meaning behind it, so it complements those views and does not replace them.
Related and rival frameworks
- Domain-Driven Design. A way to decide how a business domain is divided into parts. The better pick for choosing the boundaries, with C4 as the way to draw and share them.
- TOGAF. A framework for architecture across the whole enterprise, with its own process and deliverables. The better pick when the work spans business, data, and technology, where C4 covers software structure.
- Conway's Law. The observation that systems mirror the organizations that build them. Use it to read a container diagram and ask whether the boxes line up with the teams.
Go to the source
- The C4 model: history of the model, c4model.com; the model first appeared in a workshop at QCon London in March 2010, 2010
- The C4 model: introduction, c4model.com, 2026