Water electrolysis, generating clean hydrogen, always requires high‐performance and low‐cost electrocatalysts. Ionic liquid, namely N,N‐bis(4‐(methoxycarbonyl)benzyl)‐N‐methyl‐d‐glucaminium hexaflorophosphate (MBMG‐PF6), was infiltrated into the pretreated graphene as the precursor to prepare N,P‐double doped graphene (G(PF6)). This material has been applied as a metal‐free electrocatalyst for hydrogen evolution reaction (HER), demonstrating a good catalytic activity with an onset overpotential of 100 mV, a Tafel slope of 88 mV dec−1, a 97% Faradaic efficiency (FE) and a good durability over 10 h. According to the structural and compositional studies, this good HER performance can be attributed to the N,P‐dopant and highly porous structure of this catalyst.