Microstrip antennas have several advantages. Some of them are that they have a compact shape and small dimensions. Moreover, they are also easy to be fabricated and easily connected as well as integrated with other electronic devices. Currently, designing antennas conventionally is limited by time, energy, and experience as well as expertise. As an alternative, a way to design antennas with revolutionary methods is developed using algorithms and computing. Algorithm design techniques can overcome limitations and automatically find practical solutions that usually take a long time to discover. The particle swarm optimization algorithm and a genetic algorithm can find solutions from microstrip antennas. Objective functions play an essential role in heuristic algorithms. With a proper objective function, simulation results are obtained on the particle swarm optimization algorithm with a return loss value of -47.837, VSWR of 1.0083, and impedance of 46.805 Ω. In contrast, the genetic algorithm obtains return loss of -16.157 dB, impedance of 50.233 Ω, and VSWR of 1.3687.