A flux tube is a generally tube-like (cylindrical) region of space containing a magnetic field, such that the field at the side surfaces is parallel to those surfaces. Both the cross-sectional area of the tube and the field contained may vary along the length of the tube, but the magnetic flux is always constant.
As used in astrophysics, a flux tube generally has a larger magnetic field and other properties that differ from the surrounding space. They are commonly found around stars, including the Sun, which has many flux tubes of around 300 km diameter. Sunspots are also associated with larger flux tubes of 2500 km diameter. Some planets also have flux tubes. A well-known example is the flux tube between Jupiter and its moon Io.