The kidneys are responsible for maintaining the constant chemical composition of body fluids. This process begins with high-pressure filtration in specialized glomerular capillaries located in the renal cortex. The pressure filtration produces an ultrafiltrate of plasma made up of the water and smaller molecules. As the fluid passes along the renal tubules, water, electrolytes, and non-electrolytes are reabsorbed in the required amounts by a process of selective reabsorption. Some active secretion of unwanted substances also occurs. Following this reabsorption the remaining tubule fluid is passed to the renal pelvis and then down the ureters to the bladder for storage until voided. The effort involved in all this is quite staggering. One-fifth of the daily cardiac output, about 1400 litres of whole blood, including 840 litres of plasma, passes through the kidneys. Of the 540 litres of plasma (the effective renal plasma flow) passing each day through the glomerular capillaries, one-fifth of the plasma water and small molecules are freely filtered at the glomeruli to produce about 170–180 litres per day of glomerular filtrate for the renal tubules. Since typically only 1–2 litres of urine are passed each day (that is about 1 ml per minute) 99 % of the initial filtrate is reabsorbed as the fluid passes along the renal tubules. In oliguria, urine production can fall below 300ml per day, as in severe dehydration. In situations causing polyuria, urine output can rise to several litres per day, or more, as in excessive water intake or untreated diabetes mellitus or diabetes insipidus. The kidney’s main functions are osmoregulation, acid–base balance, and the excretion of waste products of metabolism, notably urea. Osmoregulation is mostly under endocrine control by antidiuretic hormone and the renin–angiotensin–aldosterone system. Acid–base balance is driven mainly by the carbon dioxide partial pressure in renal tubule cells, although kidneys work together with lungs and the control of breathing in overall acid–base balance. The kidney has important endocrine functions. It is the source of erythropoietin, the hormone that stimulates red blood cell production in hypoxia.