Let the number of girls be represented as \(3x\) and the number of boys as \(x\), based on the given ratio of 3 to 1.
According to the problem, the total number of students is:
\[ 3x + x = 4x \]
We know that the total number of students is 400:
\[ 4x = 400 \]
To solve for \(x\), we divide both sides by 4:
\[ x = \frac{400}{4} = 100 \]
Now, since \(x\) represents the number of boys, we find:
\[ \text{Number of boys} = x = 100 \]
Thus, the number of boys in the school is \(\boxed{100}\).