PurposeThe purpose of this study is to analyze the relationship between public spending, budget imbalance and underground economy. In addition, this paper investigates how budget imbalance moderates the public spending–underground nexus.Design/methodology/approachBy utilizing a data set spanning from 1995 to 2017 of 35 OECD countries, the study has employed Dynamic Common Correlated Effects (DCCE) approach. The study is also extended to consider the marginal effects of public spending on the underground economy at different degrees of budget imbalance.FindingsThe results indicate that an increase in public spending and budget imbalance contributes to the expansion of underground economy. Interestingly, the effects of public spending on the underground economy will enhance and intensify with a higher budget imbalance level. The results are robust to various specifications and their broader implications are discussed.Practical implicationsGovernments should carefully implement a fiscal policy with a clear understanding that increasing public spending leads to the expansion of informality. Besides, policymakers should enforce supportive policies to boost economic growth, cooperation and cross-border trade to control the size of the underground economy.Originality/valueThis study stresses the role of public spending, budget imbalance on the underground economy in OECD nations. To the best of the author's knowledge, this study pioneers to explore the moderating effect of budget imbalance in the public spending–undergrround nexus.Peer reviewThe peer review history for this article is available at: https://publons.com/publon/10.1108/IJSE-09-2022-0645.