Mercury is between 28.5 million and 43.5 million miles away from the sun. The exact distance between the sun and Mercury at any given time depends on where Mercury is in its orbit; it does not orbit in a perfect circle.
Astronomers convert large distances such as these to astronomical units. An astronomical unit (AU) is 93 million miles, which is the average distance from the sun to Earth. In this regard, Mercury's average distance from the sun is 0.387 AU. To put this into perspective, Neptune's average distance from the sun is 30.1 AU. The closest Mercury comes to Earth during its orbit is 48 million miles.