Like other diseases striking predominantly the affluent societies, idiopathic nephrolithiasis is increasing in rich countries and appears to be closely related to dietary habits. In this review we summarize the latest evidence about the efficacy of dietary treatment for idiopathic calcium and uric acid stones, dealing especially with its effect on the urinary stone risk factors, stone recurrences, and clinical limitations. After a short introduction on epidemiology and pathogenesis, we review the role of the most important foods and nutrients in stone formation and protection: water and other fluids, proteins, carbohydrates, fats, salt, milk and dairy products, fruits and vegetables, and vitamins. The final part of the paper will provide practical guidelines for pursuing an anti-lithogenic diet in idiopathic calcium and uric acid stones.