Westerhout 40 or W40 is a star-forming region in the Milky Way located in the constellation Serpens. In this region, interstellar gas forming a diffuse nebula surrounds a cluster of several hundred new-born stars. The distance to W40 is 436 ± 9 pc, making it one of the closest sites of formation of high-mass O-type and B-type stars. The ionizing radiation from the massive OB stars has created an H II region, which has an hour-glass morphology.