Soil fertility declines constrain crop productivity on smallholder farms in sub-Saharan Africa. Government and non-government organizations promote the use of mineral fertilizer and improved seed varieties to redress nutrient depletion and increase crop yields. Similarly, rotational cropping with nitrogen (N)-fixing legume cover crops or trees is promoted to improve soil fertility and crop yields. We examined maize grain yields and partial N balances on 24 smallholder maize farms in western Kenya, where interventions have increased access to agricultural inputs and rotational legume technologies. On these farms, mineral fertilizer inputs ranged from 0 to 161 kg N ha-1 (mean = 48 kg N ha-1), and maize grain yields ranged from 1-7 tons ha-1 (mean = 3.4 t ha-1). Partial N balances ranged from large losses (-112 kg N ha-1) to large gains (93 kg N ha-1)with a mean of -3 kg N ha-1. Maize grain yields increased significantly with N inputs (from fertilizer and legumes) in 2012 but not in 2013 when rainfall was lower. Nitrogen inputs of 40 kg N ha-1 were required to produce 3 tons of maize ha-1. N balances varied both among farms and between years, highlighting the importance of tracking inputs and outputs on multiple farms over multiple years before drawing conclusions about nutrient management, soil fertility outcomes and food security. The addition of N from legume rotations was a strong predictor of grain yields and positive N balances in lower-yielding farms in both years. This suggested that legume rotations may be particularly important for buffering yields from climate variability and maintaining N balances in low rainfall years.