We report on room-temperature visible photoluminescence (PL) of B-doped hydrogenated nanocrystalline Si (nc-Si:H) thin films grown by plasma enhanced chemical vapor deposition. It is found that with increasing the boron doing ratio, the PL peak energy blue shifts while the PL intensity first increases and then decreases. The PL profiles can be well reproduced by using the model of Islam and Kumar [J. Appl. Phys. 93, 1753 (2003)] which incorporates the effects of quantum confinement and localized surface states, together with a log-normal rather than normal crystallite size distribution. The yielded microstructural information is in good agreement with the Raman analysis, revealing that B doping tends to reduce the size of Si nanocrystals and the PL intensity is jointly determined by the amount of amorphous Si:H phase and the fraction of B-doped Si nanocrystals. These results also provide implications to realize control of PL properties of nc-Si:H by B doping under optimized growth conditions.