Earth vs earth
When it comes to writing, this common English some people aren’t sure whether to use Earth or earth. Why is this an issue? Earth can be either a proper noun or a common noun. In English, proper nouns (nouns which signify a particular person, place, or thing) are capitalized.
Following this rule, when Earth is discussed as a specific planet or celestial body, it is capitalized: It takes six to eight months to travel from Earth to Mars. When Earth is a proper noun, "the" is usually omitted.
When you are talking about the ground or soil as a surface or stratum, then you must lowercase the word: The archaeologists excavated the earth at the site. It is acceptable to leave earth lowercase and use "the" with earth if you are talking about it as the planet we live on: The earth rotates on its axis.
But notice that idioms follow their own rules. Down to earth, what on earth, and move heaven and earth do not capitalize the planet, and four corners of the earth or salt of the earth take the definite article. Also note, there is a town called Earth, Texas. Since it’s a proper noun, it is always capitalized