Nitrogen‐doped graphdiyne (N‐GDY) is prepared through the nitriding of graphdiyne (GDY) under ammonia. This material possesses excellent ability for the fast diffusion and storage of lithium and sodium ions due to its high conductivity, wide interlayer distance, unique three‐dimensional porous structure, and associated defects from nitrogen doping. The lithium‐ion capacitor (LIC) and sodium‐ion capacitor (SIC) fabricated with N‐GDY as the negative electrode show outstanding electrochemical performance, especially having both high power density and energy density. Besides exhibiting an energy density of 174 Wh kg−1, the N‐GDY‐based LIC can still offer an energy density of 107 Wh kg−1 even at a power density of 11250 W kg−1, whereas the N‐GDY‐based SIC can retain an energy density of 119 Wh kg−1 at a power density of 22500 W kg−1. The energy densities of N‐GDY‐based LIC and SIC are higher than those of pure GDY and many other carbon materials.