Low intrinsic electrocatalytic activity and inferior conductivity limit the application of Ni/NC in acidic electrocatalytic hydrogen evolution reaction (HER). Herein, we prepared nitrogen-doped carbon nanosheet confined PtNi alloy electrocatalysts (PtNi/NC-10) using PtCl62− electrostatic adsorption coupling melamine pyrolysis nitriding strategy. PtNi alloying was confirmed by the crystallinity decrease and lattice expansion of Ni/NC. The alloying and confinement effect of Metal-Organic Frameworks (MOFs) suppresses the oxidation and agglomeration of metal nanoparticles during pyrolysis, thus significantly reducing particle size, increasing specific surface area, and promoting the exposure of active sites. The strong electronic interaction between Pt and Ni optimizeds the surface charge distribution, enhancing the adsorption of H species on electron-rich Pt sites, thereby improving reaction kinetics. In addition, PtNi alloying improves the conductivity of the material, accelerating charge transfer and proton transport. Consequently, the prepared PtNi/NC-10 exhibits superior HER performance than Ni/NC in 0.5 M H2SO4 solution, even comparable to commercial 20 wt% Pt/C, with the overpotentials of 35 mV at 0.01 A cm−2. Furthermore, the electrocatalysts assembled PtNi/NC-10-CP‖RuO2-TFF proton exchange membrane (PEM) electrolyzer only requires 2.32 V cell voltage to achieve 1 A cm−2, presenting practical application prospects. Our work provides a novel idea for designing efficient and stable MOFs confined to alloy-based HER electrocatalysts.