In hyperthermia treatments performed with a radio-frequency phased array, the main issue to apply the excitation amplitudes and phases of the applicators for which tumour heating is optimal, i.e. the maximal therapeutic gain without unwanted side effects. Due to the complex interaction of the radiated EM-field and the patient's tissues, it is very difficult to find these optimal excitation (amplitude and phase) parameters by intuition. Calculation of the EM-field distribution within the patient can aid in finding the optimal excitation setting. However, this remains a difficult task because of the degrees of freedom available (2n - 1, with n the number of applicators in the array) and because a large temperature elevation may occur at healthy tissue sites resulting in unwanted side effects, e.g. pain or healthy tissue damage. Therefore, determining the excitation amplitudes and phases yielding optimal tumour heating can be done effectively only by application of a computerized optimization procedure. Optimization of the temperature distribution in the patient requires detailed knowledge of the thermal tissue parameters. Techniques for determining these properties are not commonly available and the use of averaged values for parameters like the tissue perfusion is expected to introduce large errors for individual patient treatment planning. As a consequence, the SAR distribution, being proportional to the temperature increase at treatment start, is more often selected for optimization. The 'optimized' excitation amplitudes and phases are found by maximization of a certain SAR ratio. Several propositions for this SAR ratio have been reported in the literature, e.g. the ratio of the SAR at the tumour site and the SAR at sites where unwanted side effects may occur. However, the definition of these ratios does not constrain the SAR value at these tissue locations to a safe value. In this paper, a tool for the optimization of the SAR distribution including the specification of constraints is presented. The tool focuses on the definition of the average SAR as a function of the excitation amplitudes and phases in a volume of arbitrary size (e.g. the tumour volume or the whole patient volume). These functions can be applied in either customized or commercially available optimization routines and they enable the definition of constraints for the average SAR in a certain volume. The described tool is illustrated for a patient case, showing the flexibility and easy application of the tool.