The C4 model is a software architecture diagramming technique that uses a set of hierarchical diagrams to describe the static structure of a software system. It is based on a structural decomposition of a system into containers and components and relies on existing modeling techniques such as the Unified Modeling Language (UML) or Entity Relation Diagrams (ERD) for the more detailed decomposition of the architectural building blocks.
The C4 model facilitates collaborative visual architecting and evolutionary architecture in the context of agile teams where more formal documentation methods and up-front architectural design are not desired.
The C4 model is a four-level model, with each level representing a different level of detail about the software system:
- Level 1 Context diagram: Shows the system’s context, such as core systems, external systems and its users.
- Level 2 Container diagram: Shows the system’s containers, such as its applications and its databases.
- Level 3 Component diagram: Shows the system’s components, such as its objects and its classes.
- Level 4 Code diagram: Shows the system’s code, such as its methods and its classes.
The C4 model is a flexible and scalable model that can be used to describe software systems of all sizes and complexities. It is a powerful tool for communicating software architecture to stakeholders, both technical and non-technical.
Example
The example below depicts the context diagram for Big Bank PLC:

We then drill down to show the container diagram for the Internet Banking System:

We then drill down even further to show the component diagram for the API Application:

Finally, we can create the class diagram (not shown here because this style of diagram has been around for a very long time and is well understood) for the components depicted in the component diagram above. All these diagrams above were created using PlantUML and its C4 plugin.