A novel porous carbon nanospheres doped with nitrogen (N@MCNs) was prepared from hyper-crosslinked polystyrene nanospheres with melamine-assisted carbonization. The N element are found to be evenly distributed in the entire carbon nanospheres, the as-prepared N@MCNs are effective in reducing friction and wear as an additive, which was attributed to the robust protective films that occurred because of tribo-chemical reactions induced via N@MCNs. The formation of protective films comprising nitrides and metal oxides can improve anti wear and friction reduction performance of 500SN. The friction coefficient of N@MCNs was reduced from 0.413 to 0.11, the wear volume was reduced by 83.5%. The experiment provides a reliable and effective approach to preparing co-doped carbon nanospheres from inexpensive polystyrene for friction and wear reduction.