Semiconducting nanowires grown by the VLS method can develop non-uniform doping profiles along the growth direction due to unintentional surface doping during synthesis. For CVD growth using hydride precursors, surface doping can be suppressed by high H2 partial pressures, thereby improving the uniformity of the dopant distribution. Quantitative calculations of the electrostatic field and carrier concentration derived from scanning photocurrent microscopy measurements confirm suppression of surface doping by phosphine for Si nanowires grown in H2 compared with those grown in He. Nanowires grown in He show 100-fold increases in carrier concentration through surface doping, whereas nanowires grown in a large H2 partial pressure show only two-fold increases for similar growth times. As a result, the carrier concentration gradients are greatly reduced for nanowires grown in H 2. These results demonstrate a general approach to in situ control of the surface doping in CVD of nanowires.