Skip to content
GitHubLinkedIn

C4 model

The C4 model is a lightweight, structured approach to visualize and document software architecture using a hierarchical set of diagrams. It helps bridge communication gaps by providing different levels of abstraction, like a map you can zoom in and out of.

“C4” refers to four levels of diagrams:

Shows a software system as a single box in its environment:

  • People (actors/roles/personas) who use the system
  • External software systems it interacts with
  • The system boundary (what’s in scope vs out of scope)

This view works well for both technical and non-technical stakeholders because it focuses on purpose and scope, not implementation details.

Decomposes the system into its major building blocks (“containers”), such as:

  • Web apps and mobile apps
  • API services
  • Databases and data stores

This view communicates the high-level internal structure and the relationships between containers.

Zooms into a container to show the major components inside it: cohesive groupings of responsibilities behind clear interfaces (e.g., authentication, reporting, workflow orchestration).

This view is most useful for engineers working on (or integrating with) a specific part of the system.

Shows the code elements that implement components (classes, functions, modules, etc). This level is often generated automatically by tools and is not always maintained manually.

  • Clear communication: a common visual language for different audiences.
  • Progressive detail: readers can stop at the “zoom level” they need.
  • Maintainability: diagrams can be kept close to the evolving system (“diagrams as code”).
  • Onboarding: new team members can learn the architecture in layers.