Inspired by G. Perelman’s seminal work on the entropy formula for the Ricci flow, we prove the W-entropy formula for the heat equation associated with the Witten Laplacian on n-dimensional complete Riemannian manifolds with the CD(K, m) condition, where K ∈ R and m ∈ [n, ∞]. Moreover, we prove an analogue of the W-entropy formula for the geodesic flow on the Wasserstein space over Riemannian manifolds. Our result improves an earlier result due to J. Lott and C. Villani on the geodesic displacement convexity of the Boltzmann-Shannon entropy on Riemannian manifolds with non-negative Ricci curvature. To better understand the similarity between above two W-entropy formulas, we introduce the Langevin deformation of geometric flows on the tangent bundle over the Wasserstein space and prove an extension of the W-entropy formula for the Langevin deformation. Finally, we study the hydrodynamic limit of the Langevin deformation.