A magnetic nitrogen-doped porous carbon was facilely prepared and exhibited superior adsorption properties for BSA-boned bilirubin.