This clinical trial study will be conducted to compare the efficacy of metformin versus insulin in controlling blood sugar of gestational diabetes mellitus. All pregnant women with 18-40 years old at 24 to 28 weeks of gestational age, diagnosed as gestational diabetics by the glucose tolerance test, will enter the study by convenience sampling. All subjects will be recommended a diabetes diet and exercise for at least an hour of daily walking and they will be asked to measure and record their fasting blood sugar and 2 hours after a meal by using a glucometer at home. Then 280 people who, despite diet and exercise within at least one week, have high fasting blood glucose and 2 hours after a meal more than 95 and 120 respectively, will be allocated by block randomization in the two intervention (140 patients) and control groups (140 persons). In the intervention group, treatment with metformin will be started with a daily dose of 500 mg and this amount will be adjusted maximally to 1500 mg in two weeks according to blood glucose. During the treatment with maximum doses of metformin, those whose fasting blood sugar remain greater than 95 and their two-hour blood glucose higher than 120 will be omitted and replace by new people. In the control group, subcutaneous injection of 0.7 IU / kg insulin will be started and increased based on blood glucose recorded daily by patients. During the study, monitoring treatment process is self- monitoring blood glucose (SMBG). Finally, the average FBS and HPP 2 after lunch and dinner, pregnancy outcomes such as type of delivery, birth weight, Apgar score, need for NICU by midwives collaborator who is not informed of the intervention, will be evaluated.