Removal of divalent metal ions (Mg and Ca) by graphene membrane has a great implication for manufacturing chitin and chitosan in filtration process. Despite its importance, influences of the doping and vacancy in graphene on the adsorption of those metal ions remain unclear. Here, we study the adsorption of those metal ions on several graphene surfaces, namely pristine graphene (Gra), graphitic N- and B- doped graphene (N- and B-Gra), monovacancy graphene (MV-Gra), monovacancy graphene functionalized by an epoxy (O-MV-Gra), and monovacancy graphene func- tionalized by an hydroxyl group (OH-MV-Gra) by van der Waals density functional (vdW-DF) method. It was found all considered graphene surfaces have strong interactions with Ca, whereas Mg only chemisorbs on MV-Gra and B-Gra. Energetically, comparing with Ca adosprtion on pris- tine graphene, both B doping and vacancy creation strengthen the Ca adsorption, while N doping slight decreases it. The electronic structure analysis uncovers enhancement of the Ca–graphene interaction by B doping and vacancy formation. Because of the results that have been observed, the removal of Ca ions from aqueous solution can be enhanced by the creation of nanopore or B doping in graphene, in which Ca atom are strongly captured by graphene.