Solenoid is the most preferred geometry for MJ class–based HTS-based SMES; however, current carrying capacity is limited by the radial component of magnetic field. Optimization of dimensions is required for reducing the refrigeration cost, cost of 2 G HTS tape, structural support, and cryostat dimensions. A new optimized shape, which looks like a solenoid from the outside but has a different inner radius for each double pancake (DP) coil, is obtained using teaching learning-based optimization (TLBO) for minimum length and 1 MJ stored energy. The structural integrity and the operating current of SMES coil degrade due to high Lorentz force; therefore, stress is also included in optimization process as a constraint. COMSOL along with MATLAB is used for shape optimization. The operating current is increased by reducing the perpendicular component in these novel shapes thereby, reducing the total HTS tape length. These shapes are compared with the optimized perfect solenoid in terms of HTS tape length, stress, and inductance.