The ratio of girls to boys is 3 to 1, which means for every 3 girls, there is 1 boy.
Let \( G \) be the number of girls and \( B \) be the number of boys. According to the ratio, we can set up the relationship:
\[ \frac{G}{B} = \frac{3}{1} \]
From this, we know that:
\[ G = 3B \]
The total number of students is given as 400:
\[ G + B = 400 \]
Now, substituting \( G \) from the first equation into the second equation:
\[ 3B + B = 400 \]
This simplifies to:
\[ 4B = 400 \]
Now, divide both sides by 4:
\[ B = \frac{400}{4} = 100 \]
So, the number of boys in the school is \( \boxed{100} \).