The electrochemical nitrogen fixation under mild conditions is a promising alternative to the current nitrogen industry with high energy consumption and greenhouse gas emission. Here, a nanoporous boron carbide (np‐B13C2) catalyst is reported for electrochemical nitrogen fixation, which is fabricated by the combination of metallurgical alloy design and chemical etching. The resulting np‐B13C2 exhibits versatile catalytic activities towards N2 reduction reactions (NRR) and N2 oxidation reaction (NOR). A high NH3 yield of 91.28 µg h−1 mgcat.−1 and Faradaic efficiency (FE) of 35.53% at −0.05 V versus the reversible hydrogen electrode are obtained for NRR, as well as long‐term stability of up to 70 h, making them among the most active NRR electrocatalysts. This catalyst can also achieve a NO3− yield of 165.8 µg h−1 mgcat.−1 and a FE of 8.4% for NOR. In situ Raman spectroscopy and density functional theory calculations reveal that strong coupling between the BC sites modulates the electronic structures of adjacent B atoms of B13C2, which enables the B sites to effectively adsorb and activate chemical inert N2 molecules, resulting in lowered energy required by the potential‐determining step. Besides, the introduction of carbon can increase the inherent conductivity and reduce the binding energy of the reactants, thus improving N2 fixation performance.