A system includes an indifferent electrode, electrical switching circuitry, and a processor. The indifferent electrode, which is configured for placement on a body of a patient, includes multiple electrically-conducting sub-electrodes that are electrically-insulated from one another. The electrical switching circuitry is configured to receive a control signal that specifies a selected subset of the sub-electrodes, and in response to electrically connect the selected subset, so as to close an electrical circuit passing through the body of the patient. The processor is configured to determine a required surface area of the indifferent electrode, select the subset of the sub-electrodes that together have the required surface area, and instruct the electrical switching circuitry to electrically connect the selected subset of the sub-electrodes.