BACKGROUND: Since pregnancy increases the risk of coronavirus disease 2019 (COVID-19) and its morbidity in pregnant women, it is necessary and recommended to prevent COVID-19 in pregnant women by vaccination such as by messenger RNA (mRNA) and inactivated vaccines. SARS-CoV-2 antibodies produced from vaccination have different results according to the type of vaccine given. The previous studies showed that IgG SARS-CoV-2 antibody levels were influenced by various factors such as gestational weeks at the time when vaccines were given. Moreover, there have been no previous studies on the effect of gestational age on quantitative IgG levels after the second dose of the vaccine especially in Indonesia during this pandemic due to some restrictions on daily activities. AIM: The aim of this study is to see the effect of giving the COVID-19 vaccine based on maternal gestational age (in trimester units) on maternal immunity (IgG SARS-CoV-2) in Dr. Hasan Sadikin General Hospital Bandung, Bandung Kiwari Hospital and Dr. Slamet Hospital, Garut. METHODS: This was a retrospective and cohort study by taking secondary data using consecutive sampling from the previous tests on the levels of SARS-CoV-2 IgG antibodies after two doses of inactivated vaccine and mRNA. Healthy pregnant women 14–34 weeks at the Department of Obstetrics and Gynecology, Dr. Hasan Sadikin (RSHS) Bandung, Bandung Kiwari Hospital, and Dr. Slamet Hospital for the period October 2021 to January 2022 were the target population of this study. Based on inclusion and exclusion criteria, 103 samples met the criteria. Examination of Maternal SARS-CoV-2 IgG Antibody Levels procedures was carried out using Chemiluminescent Microparticle Immunoassay. Statistical analysis was done using IBM SPSS 28.00 and p < 0.05 was considered statistically significant. RESULTS: There was no significant difference (p = 0.236, p > 0.05) between the mean maternal age in the mRNA and inactivated vaccine groups. The mRNA and inactivated vaccine groups also had no significant difference in the gestational age category (0.70). There was a significant difference (p = 0.0001) between the levels of SARS-CoV-2 IgG antibodies after the vaccine in the mRNA and inactivated vaccine groups. There was no significant difference in the levels of SARS-CoV-2 IgG antibodies in the gestational age group after the mRNA vaccine (p = 0.426) and after the inactivated vaccine (p = 0.293). There was a significant difference (p < 0.05) in the subgroup analysis in each gestational age group (second trimester and third trimester) between SARS-CoV-2 IgG antibody levels after the mRNA vaccine compared to inactivated vaccine. DISCUSSIONS: The mRNA vaccine is based on the principle that mRNA is an intermediate messenger to be translated to an antigen after delivery to the host cell via various routes. However, inactivated vaccines contain viruses whose genetic material has been destroyed by heat, chemicals, or radiation, so they cannot infect cells and replicate but can still trigger an immune response. The administration of the vaccine in the second and third trimesters of pregnancy has the same results in increasing levels of SARS-CoV-2 IgG antibodies after mRNA and inactivated vaccination in this study. CONCLUSIONS: mRNA vaccination in pregnant women is better than inactivated vaccines based on the levels of IgG SARS-CoV-2 antibodies after vaccination. The maternal trimester of pregnancy was not a factor influencing the levels of SARS-CoV-2 IgG antibodies after either mRNA or inactivated COVID-19 vaccinations in this study.