Interest in manure handling has been rekindled in Sweden because of increasing awareness of environmental problems and high fertilizer prices. This study deals with the problem of optimizing the design of manure systems on Swedish farms.A mathematical model has been used which describes slurry systems for farms with growing fattening pigs and dairy cows and also solid manure systems for farms with dairy cows. The model deals with manure handling from animal to field crop, with an emphasis on application. Storage capacity and the quantity spread in different seasons were optimized using mixed integer linear programming. Various manure systems were compared when used in an economically optimal way. Key factors were uniformity of application, nitrogen losses through leaching and ammonia volutilization, timeliness and soil compaction. These factors place contradictory demands on the technical design of the equipment and on the timing of applications.Solid manure systems appear to be more profitable than slurry systems for small dairy farms with about 20 cows. For larger farms, slurry systems are better. Slurry systems will generally give a higher utilization of plant nutrients than solid manure systems. The utilization of nitrogen when using liquid manure is about 50% compared with about 30% for solid manure.A slurry tanker with conventional application equipment, i.e. a splash plate is the most profitable slurry spreader for small farms with 20 cows or 250 pig places. A low spreading boom is better on a larger scale, with about 2000 pigs or 160 dairy cows. A pendular nozzle is preferred on a scale in between. Irrigation systems for liquid manure may be profitable in even larger-scale systems.Some promising areas for technical development are identified, such as improved urine separation in solid manure systems and application with irrigation equipment in large-scale slurry systems.