In this paper, a microstructure-based three-dimensional (3D) finite element modeling method is adopted to investigate the effects of porosity in thin-walled high pressure die-cast (HPDC) magnesium alloys on their ductility. For this purpose, the cross-sections of AM60 casting samples are first examined using optical microscope and X-ray tomography to obtain the general information on the pore distribution features. The experimentally observed pore distribution features are then used to generate a series of synthetic microstructure-based 3D finite element models with different pore volume fractions and pore distribution features. Shear and ductile damage models are adopted in the finite element analyses to induce the fracture by element removal, leading to the prediction of ductility. The results in this study show that the ductility monotonically decreases as the pore volume fraction increases and that the effect of ‘skin region’ on the ductility is noticeable under the condition of same local pore volume fraction in the center region of the sample and its existence can be beneficial for the improvement of ductility. The further synthetic microstructure-based 3D finite element analyses are planned to investigate the effects of pore size and pore size distribution etc.