A head unit for an ultrasonic probe includes a connecting section, an element chip, and a storing section. The connecting section is configured to electrically connect the head unit to a probe main body of the ultrasonic probe. The element chip includes an ultrasonic element array and configured to be electrically connected to a programmable gain amplifier of the probe main body through the connecting section. The storing section is configured to store gain setting information for setting a gain of the programmable gain amplifier. The storing section is configured to output the gain setting information to a processing device of the probe main body through the connecting section, and the processing device is configured to set the gain of the programmable gain amplifier based on the gain setting information.