The microcosm–macrocosm analogy (or, equivalently, macrocosm–microcosm analogy) refers to a historical view which posited a structural similarity between the human being (the microcosm, i.e., the small order or the small universe) and the cosmos as a whole. Truths about the nature of the cosmos as a whole may be inferred from truths about human nature, and vice versa.

One important corollary of this view is that the cosmos as a whole may be considered to be alive, and thus to have a mind or soul (the world soul), a position advanced by Plato in his Timaeus. Moreover, this cosmic mind or soul was often thought to be divine, most notably by the Stoics and those who were influenced by them, such as the authors of the Hermetica. Hence, it was sometimes inferred that the human mind or soul too was divine in nature.

The view itself is ancient, and may be found in many philosophical systems world-wide, such as for example in ancient Mesopotamia, in ancient Iran, or in ancient Chinese philosophy. However, the terms microcosm and macrocosm refer more specifically to the analogy as it was developed in ancient Greek philosophy and its medieval and early modern descendants.

In contemporary usage, the terms microcosm and macrocosm are also employed to refer to any smaller system that is representative of a larger one, and vice versa.