In this study, alpha-galactooligosaccharides (alpha-GOSs) were synthesized using galactose as the substrate and alpha-galactosidase from Aspergillus niger as the catalyst. In the reaction, synthesized products of U1, U2, U3, and U4 were detected by high-performance liquid chromatography. By mass spectrometry, nuclear magnetic resonance, and 1-phenyl-3-methyl-5-pyrazolone derivatization, U1 was the mixture of disaccharides of alpha-D-Galp-(1 -> 1)-alpha-D-Gal, alpha-D-Galp-(1 -> 2)-alpha-D-Gal, alpha-D-Galp- (1 -> 3)-alpha-D-Gal, alpha-D-Galp-(1 -> 4)-alpha-D-Gal, U2 was identified to be alpha-D-Galp-(1 -> 6)-alpha-D-Gal, U3 was the mixture of galactotrisaccharides linked by one alpha-(1 -> 6)-glycosidic linkage and one other alpha-glycosidic linkage, and U4 was identified as alpha-D-Galp-(1 -> 6)-alpha-D-Galp-(1 -> 6)-alpha-D-Gal. Afterward, the synthesized alpha-GOSs (U1, U2, U3, U4, and their mixture) as well as a-GOSs (manninotriose, stachyose, ciceritol, and verbascose) obtained from natural materials were used as subjects to evaluate their immunomodulatory effects in vitro by culturing mouse macrophage RAW264.7 cells. The results showed that alpha-GOS with a higher degree of polymerization had better immunomodulatory activity, while to a certain extent, a-GOS linked with alpha-(1 -> 6)-galactosidic linkage showed a better immunomodulatory effect.