Whether space is a vacuum or not depends on the definition of a vacuum. If a vacuum is defined as space that is completely devoid of matter, then space is not a vacuum. There are a large number of stars, interstellar matter, and cosmic rays in space.
But if a vacuum is defined as a space with an extremely low density of matter, then space can be considered as a vacuum. Outside the Earth's atmosphere, the density of the atmosphere decreases rapidly, and by the time the Kármán line is about 100 kilometers from the Earth, the density of the atmosphere is already very low, only one millionth of the density of the Earth's atmosphere. Beyond the Kármán line, the atmosphere is largely gone, and space can be considered a vacuum.
The specific analysis is as follows:
substance
There are a large number of stars in space, including stars, planets, moons, etc. These stars are all made up of a large amount of matter, such as hydrogen, helium, carbon, etc. In addition, there are interstellar materials in space, such as dust, gas, etc. The density of these interstellar materials is low, but there is still a lot of material in general.
Cosmic rays
Cosmic rays are a stream of high-energy particles that are mainly composed of protons, electrons, neutrons, etc. The energy of cosmic rays is very high and can reach millions of electron volts or even higher. Cosmic rays travel in space at extremely high speeds, with almost no matter blocking them.
Therefore, from a material point of view, space is not a vacuum. But from the point of view of the density of matter, space can be considered a vacuum.