An ergodic study of Painlevé VI is developed. The chaotic nature of its Poincaré return map is established for almost all loops. The exponential growth of the numbers of periodic solutions is also shown. Principal ingredients of the arguments are a moduli-theoretical formulation of Painlevé VI, a Riemann-Hilbert correspondence, the dynamical system of a birational map on a cubic surface, and the Lefschetz fixed point formula.