The rodent liver eliminates toxic ammonia. In mammals, three enzymes (or enzyme systems) are involved in this process: glutaminase, glutamine synthetase and the urea cycle enzymes, represented by carbamoyl phosphate synthetase. The distribution of these enzymes for optimal ammonia detoxification was determined by numerical optimization. This in silico approach predicted that the enzymes have to be zonated in order to achieve maximal removal of toxic ammonia and minimal changes in glutamine concentration. Using 13 compartments, representing hepatocytes, the following predictions were generated: glutamine synthetase is active only within a narrow pericentral zone. Glutaminase and carbamoyl phosphate synthetase are located in the periportal zone in a non-homogeneous distribution. This correlates well with the paradoxical observation that in a first step glutamine-bound ammonia is released (by glutaminase) although one of the functions of the liver is detoxification by ammonia fixation. The in silico approach correctly predicted the in vivo enzyme distributions also for non-physiological conditions (e.g. starvation) and during regeneration after tetrachloromethane (CCl4) intoxication. Metabolite concentrations of glutamine, ammonia and urea in each compartment, representing individual hepatocytes, were predicted. Finally, a sensitivity analysis showed a striking robustness of the results. These bioinformatics predictions were validated experimentally by immunohistochemistry and are supported by the literature. In summary, optimization approaches like the one applied can provide valuable explanations and high-quality predictions for in vivo enzyme and metabolite distributions in tissues and can reveal unknown metabolic functions.