Slow slip events occur worldwide and could trigger devastating earthquakes, yet it is still debated whether their moment-duration scaling is linear or cubic and a fundamental model unifying slow and fast earthquakes is still lacking. Here, we show that the rupture propagation of simulated slow and fast earthquakes can be predicted by a newly-developed three-dimensional theory of dynamic fracture mechanics accounting for finite rupture width, an essential ingredient missing in previous theories. The complete spectrum of rupture speeds is controlled by the ratio of fracture energy to energy release rate. Shear stress heterogeneity can produce a cubic scaling on a single fault while effective normal stress variability produces a linear scaling on a population of faults, which reconciles the debated scaling relations. This model provides a new framework to explain how slow slip might lead to earthquakes and opens new avenues for seismic hazard assessment integrating seismological, laboratory and theoretical developments.