The Earth’s crust is its top layer, with a thickness of 5 km (3 mi) to 10 km (6 mi) for the oceanic crust, and 30 km (20 mi) to 50 km (30 mi) for the continental crust. This is less than 1% of the entire depth of the Earth. The crust is differentiated into an oceanic portion, composed of denser rocks such as basalt, diabase, and gabbro, and a continental crust portion, composed of lighter rocks such as granite.
The Earth’s crust initially formed in the Hadean Eon, between 4.6 and 3.9 billion years ago. The Earth began as a molten ball of rock, but within 100-150 million years, the surface cooled and hardened. The heavier elements, such as iron and nickel, mostly sank to the Earth’s core, leaving the lighter elements at the top. Today, the oldest known rocks are zircons from the Canadian Shield dated to 4.4 billion years ago. The present-day crust itself has a range of ages, from greater than 3 billion years old to less than a hundred million years old for oceanic crust.
Both the continental and oceanic crust are composed of tectonic plates which float on top of the molten layer underneath, the mantle. Separating the Earth's crust and the mantle is a boundary called the Mohorovicic discontinuity, defined as a change in rock plasticity and seismic velocity. Much of what we know of the inner structure of the Earth has been learned by measuring the velocities of seismic waves traveling through it.
The oceanic crust, being denser than continental crust, is constantly being subducted — drawn underneath other tectonic plates — and pushed into the mantle, where it melts. Great rift valleys form where plates move apart, while mountains form where they collide. In these rift valleys, magma comes up from beneath the surface to replace the crust lost due to subduction. The entire oceanic crust recycles itself every couple hundred million years.
Life on Earth is primarily responsible for the current chemical makeup of the Earth’s crust. As oxygen is a byproduct of photosynthesis, and photosynthesizing organisms evolved over 2 billion years ago, large amounts of oxygen have been released over the Earth's history, and more than 99% of the crust is composed of various oxides. Some exceptions are chlorine, sulfur, and fluorine. Silicon oxide (SiO2) is the most abundant oxide, making up about 60% of the crust, followed by aluminum oxide (Al2O3) making up 15%, with calcium oxide, magnesium oxide, iron oxide, titanium oxide, and a few others making up the remainder.