According to the BBC, electromagnetic waves can move freely through a vacuum, as they do not need to travel through matter. In fact, although a slight difference between speeds exists, electromagnetic waves travel faster in a vacuum than through matter.
The electromagnetic spectrum is composed of waves with varying lengths that all travel at the speed of light (approximately 186,000 miles per hour in a vacuum). Wave length is determined by frequency, with the higher frequencies having smaller wave lengths and vice versa. Higher frequency electromagnetic waves include gamma rays, X-rays and ultraviolet rays. Lower frequency electromagnetic waves include infrared radiation, radio waves and microwaves.