Abstract. The physics of energy transfer between the laser and the plasma in laser wakefield accelerators is studied. We find that wake excitation by arbitrary laser shapes can be parameterized using the total pulse energy and pulse depletion length. A technique for determining laser profiles that produce the required plasma excitation is developed. We show that by properly shaping the longitudinal profile of the driving laser pulse, it is possible to maximize both the transformer ratio and the wake amplitude, achieving optimal laser-plasma coupling. The corresponding family of laser pulse shapes is derived in the nonlinear regime of laser-plasma interaction. Such shapes provide theoretical upper limit on the magnitude of the wakefield and efficiency of the accelerating stage by allowing for uniform photon deceleration inside the laser pulse. We also construct realistic optimal pulse shapes that can be produced in finitebandwidth laser systems and propose a two-pulse wake amplification scheme using the optimal solution.