BACKGROUND: Neonatal mortality rates (NMRs) in countries of low and middle income have been only slowly decreasing; coverage of essential maternal and newborn health services needs to increase, particularly for disadvantaged populations. Our aim was to produce comparable estimates of changes in socioeconomic inequalities in NMR in the past two decades across these countries. METHODS: We used data from Demographic and Health Surveys (DHS) for countries in which a survey was done in 2008 or later and one about 10 years previously. We measured absolute inequalities with the slope index of inequality and relative inequalities with the relative index of inequality. We used an asset-based wealth index and maternal education as measures of socioeconomic position and summarised inequality estimates for all included countries with random-effects meta-analysis. FINDINGS: 24 low-income and middle-income countries were eligible for inclusion. In most countries, absolute and relative wealth-related and educational inequalities in NMR decreased between survey 1 and survey 2. In five countries (Cameroon, Nigeria, Malawi, Mozambique, and Uganda), the difference in NMR between the top and bottom of the wealth distribution was reduced by more than two neonatal deaths per 1000 livebirths per year. By contrast, wealth-related inequality increased by more than 1·5 neonatal deaths per 1000 livebirths per year in Ethiopia and Cambodia. Patterns of change in absolute and relative educational inequalities in NMR were similar to those of wealth-related NMR inequalities, although the size of educational inequalities tended to be slightly larger. INTERPRETATION: Socioeconomic inequality in NMR seems to have decreased in the past two decades in most countries of low and middle income. However, a substantial survival advantage remains for babies born into wealthier households with a high educational level, which should be considered in global efforts to further reduce NMR. FUNDING: Canadian Institutes of Health Research.