Which compound contains the highest percentage of nitrogen by mass?

$ \textbf{(A)} \text{NH}_2\text{OH} (M=33.0) \qquad\textbf{(B)}\text{NH}_4\text{NO}_2 (M=64.1)\qquad$
$\textbf{(C)}\text{N}_2\text{O}_3 (M=76.0)\qquad\textbf{(D)}\text{NH}_4\text{NH}_2\text{CO}_2 (M=78.1)\qquad $
To determine which compound contains the highest percentage of nitrogen by mass, we need to calculate the mass percentage of nitrogen in each compound. The mass percentage of an element in a compound is given by:

\[
\text{Mass percentage of element} = \left( \frac{\text{Mass of element in one mole of compound}}{\text{Molar mass of compound}} \right) \times 100\%
\]

Let's calculate the mass percentage of nitrogen for each compound:

1. **Compound (A): NH\(_2\)OH**
   - Molar mass of NH\(_2\)OH = 33.0 g/mol
   - Mass of nitrogen in NH\(_2\)OH = 14 g/mol (since there is 1 nitrogen atom)
   - Mass percentage of nitrogen:
     \[
     \frac{14 \text{ g}}{33.0 \text{ g/mol}} \times 100\% = 42.42\%
     \]

2. **Compound (B): NH\(_4\)NO\(_2\)**
   - Molar mass of NH\(_4\)NO\(_2\) = 64.1 g/mol
   - Mass of nitrogen in NH\(_4\)NO\(_2\) = 2 \times 14 g/mol = 28 g/mol (since there are 2 nitrogen atoms)
   - Mass percentage of nitrogen:
     \[
     \frac{28 \text{ g}}{64.1 \text{ g/mol}} \times 100\% = 43.68\%
     \]

3. **Compound (C): N\(_2\)O\(_3\)**
   - Molar mass of N\(_2\)O\(_3\) = 76.0 g/mol
   - Mass of nitrogen in N\(_2\)O\(_3\) = 2 \times 14 g/mol = 28 g/mol (since there are 2 nitrogen atoms)
   - Mass percentage of nitrogen:
     \[
     \frac{28 \text{ g}}{76.0 \text{ g/mol}} \times 100\% = 36.84\%
     \]

4. **Compound (D): NH\(_4\)NH\(_2\)CO\(_2\)**
   - Molar mass of NH\(_4\)NH\(_2\)CO\(_2\) = 78.1 g/mol
   - Mass of nitrogen in NH\(_4\)NH\(_2\)CO\(_2\) = 2 \times 14 g/mol = 28 g/mol (since there are 2 nitrogen atoms)
   - Mass percentage of nitrogen:
     \[
     \frac{28 \text{ g}}{78.1 \text{ g/mol}} \times 100\% = 35.85\%
     \]

Comparing the mass percentages of nitrogen in each compound:
- (A) NH\(_2\)OH: 42.42%
- (B) NH\(_4\)NO\(_2\): 43.68%
- (C) N\(_2\)O\(_3\): 36.84%
- (D) NH\(_4\)NH\(_2\)CO\(_2\): 35.85%

The compound with the highest percentage of nitrogen by mass is NH\(_4\)NO\(_2\).

The final answer is $\boxed{\text{B}}$.