The use of series elastic actuators (SEA) in the applications with presence of human machine coupling has received extensive attention. One of the important research questions is how to design more efficient and compact flexible joints using physical springs. In this research work, we propose an optimization method for designing a planar torsional spiral spring with a shape of Archimedes curve. To define this optimization problem, the objective function and the constraint condition equations are put forward. We set the minimization of final volume, diameter and height of the spring as the optimization goal, the fixed stiffness of the spring as an equality constraint, the maximum deformation angle and the maximum stress of the spring when it reaches this angle, which should be less than the allowable, as two inequality constraints. To solve this optimization problem, the Spiral Dynamics Algorithm (SDA) is utilized to obtain the optimal parameter vector for this nonlinear constrained optimization problem. To validate the optimal result, a simulation with finite element analysis (FEA) is carried out, and the result shows that the obtained solution vector meets the design goal.