Hypokalaemia and hyperkalaemia are common complications of heart failure and its treatment: either may increase markedly the risk of arrhythmias and sudden cardiac death. Hypokalaemia predominates in the early stages of heart failure. The risk of hyperkalaemia increases as renal function declines, usually in the context of advancing heart failure. For patients with heart failure, serum potassium levels of between 4.5–5.5 mmol/L are recommended. Monitoring of serum potassium is essential, with more frequent monitoring in patients with moderate renal failure, relatively high serum potassium, or in those at high risk of renal impairment, e.g. elderly or diabetic patients. Hypokalaemia can be ameliorated by a potassium-sparing diuretic or an aldosterone receptor antagonist; increasing dietary potassium intake or taking potassium supplements is less effective. Doses of loop or thiazide diuretics should be optimised. Hyperkalaemia is more often seen in advanced heart failure. Restriction of dietary potassium and withdrawal of potassium supplements are standard. Temporary discontinuation of angiotensin-converting enzyme inhibitor and/or aldosterone receptor antagonist therapy may be appropriate but attempts should be made to reintroduce these. Excessive diuretic therapy should be avoided. With routine potassium monitoring and pre-emptive intervention included in heart failure protocols, the risks to patients can be minimised.