The Claim: Eating late at night causes you to gain fat.
Gaining weight is simply a matter of eating excess calories. WHEN you eat those calories is irrelevant. But there is a persistent myth that eating late at night somehow causes you to store more fat that eating earlier in the day. There is no scientific evidence to support this idea.
If you just eat the amount of calories you burn off, then it doesn’t matter at all if you eat all of those calories at night, or in the morning or spread throughout the day.
Total calories is all that matters. So if your BMR is 1600 calories, that means you could eat all 1600 of them at midnight and not gain an ounce of fat.