Spermatids are formed through the process of meiosis. Initially, a diploid spermatogonium undergoes mitotic division to produce primary spermatocytes. Each primary spermatocyte then undergoes the first meiotic division to form two haploid secondary spermatocytes. These secondary spermatocytes undergo a second meiotic division to produce haploid spermatids.