Microwaves and RF technology and their components like filters, antennas, etc. are commonly used in wireless networking and communication systems, wireless security systems, radar systems, and environmental remote sensing. In this paper, a fast and effective procedure has been proposed for microstrip filter design using a genetic algorithm (GA) with a transmission line model (TL). GA is modified to be highly efficient and accurate by encoding the topology. For the fixed filter topology, the electrical parameters of the filter are encoded in a single chromosome. To make the proposed procedure fast and effective, a transmission line model has been employed to compute the fitness value in GA. To demonstrate the effectiveness of the proposed procedure, a wideband second-order bandpass filter with a center frequency of 2.3 GHz is examined with a pair of short-circuited stubs and a pair of open-circuited stubs. The optimized design is validated using full-wave methods (MoM and EM simulator CST). The results show a low insertion loss of 0.1 dB and return loss better than 30 dB and a wide bandwidth of 46.95% with − 3 dB cutoff frequencies at 1.76 GHz and 2.84 GHz.