Many creditworthy non-financial firms are discouraged from applying for loans, resulting in a significant gap between their potential to receive credit and the reality. To quantify the credit gap, this study combines a credit allocation rule with a scoring model that assesses the creditworthiness of discouraged firms. It covers 35 emerging markets and developing economies and uses data from the 2018-2020 EBRD-EIB-World Bank Enterprise Survey. The results show that discouraged firms are less creditworthy than successful applicants, on average. However, the share of discouraged firms that are creditworthy is large, suggesting that credit to firms is being rationed by the financial sector. The results point to an average credit gap of 8.4% of GDP, with significant variation across countries. Small and medium-sized firms account for more than two-thirds of the total gap, reflecting both their large contribution to economic activity and the fact that they are more likely to be credit-constrained than larger firms.