Astrocytoma is a common brain tumor that can occur in any part of the central nervous system. This tumor is extremely harmful to patients, and there are no clear studies on the risk factors for astrocytoma of the brain. This study was conducted based on the SEER database to determine the risk factors affecting the survival of patients with astrocytoma of the brain. Patients diagnosed with brain astrocytoma in the SEER database from 2004 to 2015 were screened by inclusion exclusion criteria. Final screened brain astrocytoma patients were classified into low grade and high grade according to WHO classification. The risk factors affecting the survival of patients with low-grade and high-grade brain astrocytoma were analyzed by univariate Kaplan–Meier curves and log-rank tests, individually. Secondly, the data were randomly divided into training set and validation set according to the ratio of 7:3, and the training set data were analyzed by univariate and multivariate Cox regression, and the risk factors affecting the survival of patients were screened and nomogram was established to predict the survival rates of patients at 3 years and 5 years. The area under the ROC curve (AUC value), C-index, and Calibration curve are used to evaluate the sensitivity and calibration of the model. Univariate Kaplan–Meier survival curve and log-rank test showed that the risk factors affecting the prognosis of patients with low-grade astrocytoma included Age, Primary site, Tumor histological type, Grade, Tumor size, Extension, Surgery, Radiation, Chemotherapy and Tumor number; risk factors affecting the prognosis of patients with high-grade astrocytoma include Age, Primary site, Tumor histological type, Tumor size, Extension, Laterality, Surgery, Radiation, Chemotherapy and Tumor number. Through Cox regression, independent risk factors of patients with two grades were screened separately, and nomograms of risk factors for low-grade and high-grade astrocytoma were successfully established to predict the survival rate of patients at 3 and 5 years. The AUC values of low-grade astrocytoma training set patients were 0.829 and 0.801, and the C-index was 0.818 (95% CI 0.779, 0.857). The AUC values of patients in the validation set were 0.902, 0.829, and the C-index was 0.774 (95% CI 0.758, 0.790), respectively. The AUC values of high-grade astrocytoma training set patients were 0.814 and 0.806, the C-index was 0.774 (95% CI 0.758, 0.790), the AUC values of patients in the validation set were 0.802 and 0.823, and the C-index was 0.766 (95% CI 0.752, 0.780), respectively, and the calibration curves of the two levels of training set and validation set were well fitted. This study used data from the SEER database to identify risk factors affecting the survival prognosis of patients with brain astrocytoma, which can provide some guidance for clinicians.