How old is the Earth? Scientists think that the Earth is 4.54 billion years old. Coincidentally, this is the same age as the rest of the planets in the Solar System, as well as the Sun. Of course, it's not a coincidence; the Sun and the planets all formed together from a diffuse cloud of hydrogen billions of years ago.
In the early Solar System, all of the planets formed in the solar nebula; the remnants left over from the formation of the Sun. Small particles of dust collected together into larger and larger objects -- pebbles, rocks, boulders, etc -- until there were many planetoids in the Solar System. These planetoids collided together and eventually enough came together to become Earth-sized.
At some point in the early history of Earth, a planetoid the size of Mars crashed into our planet. The resulting collision sent debris into orbit that eventually became the Moon.
How do scientists know Earth is 4.54 billion years old? It's actually difficult to tell from the surface of the planet alone, since plate tectonics constantly reshape its surface. Older parts of the surface slide under newer plates to be recycled in the Earth's core. The oldest rocks ever found on Earth are 4.0 -- 4.2 billion years old.
Scientists assume that all the material in the Solar System formed at the same time. Various chemicals, and specifically radioactive isotopes were formed together. Since they decay in a very known rate, these isotopes can be measured to determine how long the elements have existed. And by studying different meteorites from different locations in the Solar System, scientists know that the different planets all formed at the same time.
Failed Methods for Calculating the Age of the Earth
Our current, accurate method of measuring the age of the Earth comes at the end of a long series of estimates made through history. Clever scientists discovered features about the Earth and the Sun that change over time, and then calculated how old the planet Earth is from that. Unfortunately, they were all flawed for various reasons.