This paper provides a novel dataset of time-varying measures on the degree of countercyclicality of fiscal policies for advanced and developing economies between 1980 and 2021. The use of time-varying measures of fiscal stabilization, with special attention to potential endogeneity issues, overcomes the major limitation of previous studies and allows the analysis to account for both country-specific as well as global factors. The paper also examines the key determinants of countercyclicality of fiscal policy with a focus on factors as severe crises, informality, financial development and governance. Empirical results show that (i) fiscal policy tends to be more countercyclical during severe crises than typical recessions, especially for advanced economies; (ii) fiscal countercyclicality has increased over time for many economies over the last two decades; (iii) discretionary and automatic countercyclicality are both strong in advanced economies but acyclical (at times procyclical) in low-income countries; (iv) fiscal countercyclicality operates primarily through the expenditure channel, particularly for social benefits; and (v) better financial development, larger government size and stronger institutional quality are associated with larger countercyclical effects of fiscal policy. Our results are robust to various specifications and endogeneity checks.