This paper presents the optimal design of an electromagnetic vibration-based generator using the simulated annealing method (SA). To optimally extract the vibrational energy of a system vibrating at a specific frequency, the selected mass and spring stiffness of a resonant vibration is required. The relationship between induced energy and the generator's structure, its permanent magnet height and diameter, number of turns, and wire diameter in a single air coil are discussed. Also, a prototype of the vibration-based electrical generator is built and tested via a shaker excited at resonance frequency and input amplitude of 0.06mm. Consequently, results reveal that the design parameters (permanent magnet height and diameter, number of turns, and wire diameter) play essential roles in maximizing electrical power.