Neptune is the eighth and farthest planet from the Sun. It is the fourth-largest planet by diameter and the third-largest by mass. Among the gaseous planets in the Solar System, Neptune is the most dense out of them. Neptune is 17 times the mass of Earth and is slightly more massive than its near-twin Uranus, which is 15 times the mass of Earth but not as dense as Neptune. Neptune orbits the sun at an average of 30.1 astronomical units. The planet is named after the Roman god of the sea, "Neptune", so the planet's astronomical symbol is Neptune's trident (♆).
Neptune was found by a mathematical prediction rather than by empirical observation. Unexpected changes in the orbit of Uranus led Alexis Bouvard to deduce that its orbit was subject to gravitational perturbation by an unknown planet. Neptune was then subsequently observed on September 23, 1846 by Johann Galle within a degree of the position predicted by Urbain Le Verrier, and its largest moon, Triton, was discovered shortly afterwards, but none of the planet's remaining 13 moons were located telescopically until the 20th century. Neptune was visited by Voyager 2, when it flew by the planet on August 25, 1989.
Neptune is similar in composition to Uranus, and both have compositions that differ from those of the larger gas giants, Jupiter and Saturn. Neptune's atmosphere, like Jupiter and Saturn's, is composed primarily of hydrogen and helium, along with traces of hydrocarbons and possibly nitrogen; it contains a higher proportion of "ices" such as water, ammonia, and methane.