We obtain the first results on convergence rates in the Prokhorov metric for the weak invariance principle (functional central limit theorem) for deterministic dynamical systems. Our results hold for uniformly expanding/hyperbolic (Axiom A) systems, as well as nonuniformly expanding/hyperbolic systems such as dispersing billiards, Hénon-like attractors, Viana maps and intermittent maps. As an application, we obtain convergence rates for deterministic homogenization in multiscale systems. 1 For the remainder of the introduction, we write (non)uniformly hyperbolic rather than (non)uniformly expanding/hyperbolic.