Mars is the fourth planet from the sun. It has been a favorite object of skywatchers for centuries and of space explorers for decades. The distance to Mars depends on when you measure it, and which vantage points you're considering. Just how far away is the Red Planet?

Mars orbits the sun in 687 Earth days. (Image credit: NASA)

How far is Mars from Earth?

The distance to Mars from Earth is constantly changing. Like a pair of cars on a racetrack, Mars and Earth orbit the sun at different speeds. Earth has an inside lane and moves around the sun more quickly. Plus, both have elliptical orbits, rather than perfect circles.

In theory, the closest the planets could come together would be when Mars is at its closest point to the sun (perihelion) and Earth is at its farthest point (aphelion). In that situation, the planets would be 33.9 million miles (54.6 million kilometers) from each other. But that has never happened in recorded history. The closest known approach was 34.8 million miles (56 million km) in August 2003.

Incidentally, that closest approach kicked off a social media trend. Every August, posts, memes and emails claim that Mars will appear as large as a full moon. In 2003, "someone somewhere pointed out that at a magnification of 75x in a telescope, Mars would appear as big in the eyepiece (half a degree wide) as the Moon does unmagnified," Sky & Telescope's Alan MacRobert explained. Not only did the chain letter get rewritten to omit the magnification, it also continued to spread long after 2003.

At the other end of the scale, when both planets are at aphelion — their farthest distance from the sun — and the two worlds are on opposite sides of the sun, they can be 250 million miles (401 million km) apart — a whopping 7.37 times the closest possible separation.

In their race around the sun, Earth on its inside track laps Mars every 26 months. This close approach provides an opportunity — a launch window — to send spacecraft to the Red Planet. Rather than pointing the spacecraft at Mars, engineers aim it in a wide orbit around the sun. The sun's gravity gives the spacecraft a boost — called a gravity assist or slingshot effect — saving time and fuel. The spacecraft's orbit then intersects with Mars.

"You've got this object that's going to go flying out into the air and you've got to shoot it," NASA engineer Eric Haddox said in a statement. Haddox is the lead flight design engineer in NASA's Launch Services Program at Kennedy Space Center in Florida. "You have to be able to judge how far away your target is and how fast it's moving, and make sure you reach the same point at the same time.”

NASA\'s Phoenix Mars Lander captured a sunrise Sept. 5, 2008, the 101st day since landing in the Arctic.

How far is Mars from the sun?

Mars has a very eccentric orbit; that is, it deviates from a perfect circle more than any other planet's orbit At its farthest distance (aphelion), Mars is 154 million miles (249 million km) from the sun. At its closest (perihelion), Mars is 128 million miles (206 million km) distant. On average, the distance to Mars from the sun is 142 million miles (229 million km), according to NASA. Mars revolves around the sun in 687 Earth days, which represents a Martian year.

Measuring the distance

The distance to Mars from Earth was first determined by Giovanni Cassini in 1672 using the parallax method. He sent a colleague, Jean Richer, to French Guiana while he stayed in Paris. They took measurements of the position of Mars, and triangulated those measurements with the known distance between Paris and French Guiana. Their calculations were only 7 percent off from today's more precise instruments.

Additional reporting by Nola Taylor Redd, Space.com contributor