The liquid-liquid extraction of free fatty acids (FFA) from residual oils and fats for biodiesel production, employing methanol as the solvent, has been optimized using process simulation and response surface methodology. The parameters investigated were temperature, number of stages and solvent-to-feed ratio (S/F). Responses evaluated were FFA mass fraction in the oil-rich phase (wFFA B ) and total cost, using yellow and brown greases as the raw materials. Quadratic and linear models were fitted for wFFA B and cost responses, respectively. The optimal conditions satisfying technical (wFFA B ≤ 0.5%) and economic (minimum cost, including capital and operation costs, except for raw material cost) criteria were 321 K, 6 stages, S/F = 1.27, wFFA B = 0.41%, cost = $84.93/ton (yellow grease), and 318 K, 6 stages, S/F = 1.32, wFFA B = 0.49%, cost = $102.89/ton (brown grease).