PurposeThis study's main objective is to examine the effect of learning from entrepreneurial failure on performance, with a type of failure as a moderator variable. Interactions between internal and external causes of failure and learning from entrepreneurial failure are also investigated, as well as entrepreneurs' aspects (i.e. age, experience and education) and organisational contextual factors (i.e. size, sector and location).Design/methodology/approachThis study employed a hypothetico-deductive approach through a survey of 250 purposively sampled entrepreneurs who had suffered business failures. The survey data were subjected to regression analysis and moderated regression using WarpPLS software and an independent sample t test for an in-depth analysis.FindingsThe results indicated that learning from entrepreneurial failure positively affected business performance, an effect moderated by the type of failure, particularly with large failures. Only perceived internal causes of failure exerted a positive effect on learning from entrepreneurial failure; the external causes did not. The effect of failure on business performance was stronger on entrepreneurs who were older and experienced, had non-university educations and operated small- and medium-sized enterprises (SMEs) outside Java–Bali islands.Originality/valueThis study's findings provide empirical evidence that supports the experiential learning theory and attribution theory in explaining the interaction between learning and failure, its cause, its consequences and its magnitude as perceived by entrepreneurs of SMEs in Indonesia, where the rate of failure is relatively high. The authors’ study also emphasises the roles of the entrepreneur and organisational contextual factors, which matter in learning to improve performance.