The latest research shows that ferns and lycophytes have distinct evolutionary lineages. The codon usage patterns of lycophytes and ferns have not yet been documented. To investigate the gene expression profiles across various plant lineages with respect to codon usage, analyze the disparities and determinants of gene evolution in primitive plant species, and identify appropriate exogenous gene expression platforms, the whole-genome sequences of four distinct species were retrieved from the NCBI database. The findings indicated that Ceratopteris richardii, Adiantum capillus-veneris, and Selaginella moellendorffii exhibited an elevated A/U content in their codon base composition and a tendency to end with A/U. Additionally, S. capillus-veneris had more C/G in its codons and a tendency to end with C/G. The ENC values derived from both ENC-plot and ENC-ratio analyses deviated significantly from the standard curves, suggesting that the codon usage preferences of these four species were primarily influenced by genetic mutations and natural selection, with natural selection exerting a more prominent influence. This finding was further supported by PR2-Plot, neutrality plot analysis, and COA. A combination of RSCU and ENC values was used as a reference criterion to rank the codons and further identify the optimal codons. The study identified 24 high-frequency codons in C. richardii, A. capillus-veneris, and Diphasiastrum complanatum, with no shared optimal codons among the four species. Arabidopsis thaliana and Ginkgo biloba exhibited similar codon preferences to the three species, except for S. moellendorffii. This research offers a theoretical framework at the genomic codon level for investigating the phylogenetic relationships between lycophytes and ferns, shedding light on gene codon optimization and its implications for genetic engineering in breeding.