From the point of production to consumption, electrical energy should be utilized effectively and qualitatively. Efficiency at the electricity consumption stage is not sufficient, and the desired criteria must be met at the production stage. The efficient and high‐quality generation of electrical energy is directly related to the performance of the generator used. In order to achieve the desired criteria for a generator design, many issues should be considered together. In order for this study to do, a 14‐pole and 5 kW permanent magnet synchronous generator (PMSG) was designed using the innovative optimizer named the weighted mean of vectors (INFO), the jumping spider optimization algorithm (JSOA), the teaching–learning‐based optimization (TLBO), the pelican optimization algorithm (POA) and the teaching‐learning‐studying‐based optimization (TLSBO) algorithms. The generator performance was optimized within the determined inequality constraints by the offset and embrace value and six parameters of the stator slot structure. The generator designed with the parameters determined by the TLSBO was more successful than the generators designed according to all the other proposed algorithms. The total harmonic distortion (THD) value decreased by 51.983% compared to the initial design at approximately the same efficiency.