The geology of New Zealand is noted for its volcanic activity, earthquakes and geothermal areas because of its position on the boundary of the Australian Plate and Pacific Plates. New Zealand is part of Zealandia, a microcontinent nearly half the size of Australia that broke away from the Gondwanan supercontinent about 83 million years ago. New Zealand's early separation from other landmasses and subsequent evolution have created a unique fossil record and modern ecology.

New Zealand's geology can be simplified into three phases. First the basement rocks of New Zealand formed. These rocks were once part of the super-continent of Gondwana, along with South America, Africa, Madagascar, India, Antarctica and Australia. The rocks that now form the mostly submerged continent of Zealandia were then nestled between Eastern Australia and Western Antarctica.New Zealand within Gondwana from Te Ara: The Encyclopedia of New Zealand Secondly New Zealand drifted away from Gondwana and many sedimentary basins formed, which later became the sedimentary rocks covering the geological basement. The final phase is represented by the uplift of the Southern Alps and the eruptions of the Taupō Volcanic Zone.

Basement rocks (Cambrian-Cretaceous)

New Zealand's basement rocks range in age from mid-Cambrian in north-west Nelson to Cretaceous near Kaikōura. These rocks were formed in a marine environment before New Zealand separated from Gondwana. They are divided into the "Western Province", consisting mainly of greywacke, granite and gneiss, and an "Eastern Province", consisting mainly of greywacke and schist. The provinces are further divided into terranes – large slices of crust with different geological histories that have been brought together by tectonic activity (subduction and strike-slip faulting) to form New Zealand.

The Western Province is older than the Eastern Province and outcrops along the west coast of the South Island from Nelson to Fiordland. The Western Province is divided into the Buller and Takaka terranes which formed in mid-Cambrian to Devonian time (510–400 Ma). This includes New Zealand's oldest rocks, trilobite-containing greywacke, which are found in the Cobb Valley in north-west Nelson.

Large sections of the Western Province have been intruded by plutonic rocks or metamorphosed to gneiss. These plutonic basement rocks are subdivided into the Hohonu, Karamea, Median and Paparoa batholiths. These rocks form the foundations beneath offshore Taranaki, and much of the West Coast, Buller, north-west Nelson, Fiordland and Stewart Island / Rakiura. Most of these plutonic rocks were formed in Devonian-Carboniferous time (380–335 Ma) and Jurassic-Cretaceous time (155–100 Ma). The Median Batholith represents a long-lived batholith dividing the Western and Eastern Provinces. Before Zealandia's separation from Gondwana it stretched from Queensland, through what is now New Zealand, into West Antarctica. It marks the site of a former subduction zone on the edge of Gondwana.

The Eastern Province underlies more of New Zealand than the Western Province, including the greywacke and schist of the Southern Alps and all of the basement rocks of the North Island. The Eastern Province contains seven main terranes, the Drumduan, Brook Street, Murihiku, Dun Mountain–Maitai, Caples, Torlesse composite (Rakaia, Aspiring and Pahau terranes) and Waipapa composite (Morrinsville and Hunua terranes). They are mostly composed of greywacke together with argillite, except for the Brook Street and Dun Mountain–Maitai terranes which have significant igneous components (see Dun Mountain ophiolite belt). New Zealand's greywacke is mostly from the Caples, Torlesse composite (Rakaia and Pahau) and Waipapa composite (Morrinsville and Hunua) terranes formed in Carboniferous–Cretaceous time (330–120 Ma). Much of these rocks were deposited as submarine fans. They have different origins, as shown by different chemical compositions and different fossils. In general, the sedimentary basement terranes become younger from West to East across the country, as the newer terranes were scraped off the subducting paleo-Pacific plate, and accreted to the boundary of Gondwana over hundreds of millions of years.

Many rocks in the Eastern Province have been metamorphosed into the Haast Schist, due to exposure to high pressures and temperatures. Rocks grade continuously from greywacke (e.g., in Canterbury) to high-grade schist (e.g., around the Caples-Torlesse boundary in Otago and Marlborough, and Torlesse rocks just to the East of the Alpine Fault). The Alpine Fault that corresponds to the line of the Southern Alps has separated the basement rocks that used to be adjacent by about 480 km.

Separation from Gondwana (Cretaceous–Eocene)

The Australia–New Zealand continental fragment of Gondwana split from the rest of Gondwana in the late Cretaceous time (95–90 Ma). Then around 83 Ma, Zealandia started to separate from Australia forming the Tasman Sea, initially separating from the south. By 75 Ma, Zealandia was essentially separate from Australia and Antarctica, although only shallow seas might have separated Zealandia and Australia in the north. Dinosaurs continued to live in New Zealand after it separated from Gondwana, as shown by sauropod footprints from 70 million years ago in Nelson. This meant that dinosaurs had about 20 million years to evolve unique New Zealand species. During the Cretaceous extension large normal faults formed throughout New Zealand, the Hawks Crag Breccia formed next to scarps and it has become New Zealand's best uranium mineral deposit.

Currently, New Zealand has no native snakes or land mammals (other than bats). Neither marsupials nor placental mammals evolved and reached Australia in time to be on New Zealand when it drifted away 85 million years ago. The evolution and dispersal of snakes is less certain, but there is no hard evidence of them being in Australia before the opening of the Tasman Sea. The multituberculates, another type of mammal which is now extinct, may have been in time to cross the land bridge to New Zealand.

The landmasses continued to separate until early Eocene times (53 Ma). The Tasman Sea, and part of Zealandia then locked together with Australia to form the Australian Plate (40 Ma), and a new plate boundary was created between the Australian Plate and Pacific Plate. Zealandia ended up at a pivot point between the Pacific and Australian Plates, with spreading in the south, and convergence in the north, where the Pacific Plate was subducted beneath the Australian Plate. A precursor to the Kermadec Arc was created. The convergent part of the plate boundary propagated through Zealandia from the north, eventually forming a proto-Alpine Fault in Miocene times (23 Ma). The various ridges and basins north of New Zealand relate to previous positions of the plate boundary.New Zealand splits from Gondwana from Te Ara: The Encyclopedia of New Zealand

Sedimentary basins and allochthons (Cretaceous–recent)

Erosion and deposition has led to much of Zealandia now being covered in sedimentary rocks that formed in swamps and marine sedimentary basins. Much of New Zealand was low lying around Mid Eocene–Oligocene times (40–23 Ma). Swamps became widespread, forming coal. The land subsided further, and marine organisms produced limestone deposits. Limestone of Oligocene–Early Miocene age formed in many areas, including the King Country, known for the Waitomo Glowworm Cave. In the South Island, limestone is present in Buller, Nelson, and the West Coast, including the Pancake Rocks at Punakaiki in Oligocene–Early Miocene times (34–15 Ma). It is debated whether all of New Zealand was submerged at this time or if small islands remained as "arks" preserving fauna and flora.

An allochthon is land that formed elsewhere and slid on top of other land (in other words, the material of an enormous landslide). Much of the land of Northland and East Cape were created in this manner. Around 25–22 Ma, Northland and East Cape were adjacent, with East Cape near Whangārei. Northland–East Cape was an undersea basin. Much of the land that now forms Northland–East Cape was higher land to the northeast (composed of rocks formed 90–25 Ma). The Pacific-Australian plate boundary was further to the northeast, with the Pacific Plate subducting under the Australian Plate. Layers of rocks were peeled off the higher land, from the top down, and slid southwest under the influence of gravity, to be stacked the right way up, but in reverse order. Most of the material to slide were sedimentary rocks, however, the last rocks to be slid across were slabs of oceanic crust (ophiolites), mainly basalt. Widespread volcanic activity also occurred (23–15 Ma), and is intermixed with the foreign rocks. Sedimentary basins formed on the allochthons while they were moving. East Cape was later separated from Northland and moved further south and east to its present position.

Volcanic activity

Volcanism is recorded in New Zealand throughout its whole geological history. Most volcanism in New Zealand, both modern and ancient, has been caused by the subduction of one tectonic plate under another; this causes melting in the mantle, the layer of the Earth below the crust. This produces a volcanic arc, composed of mainly basalt, andesite and rhyolite. Basaltic eruptions tend to be fairly placid, producing scoria cones and lava flows, such as the volcanic cones in the Auckland volcanic field, although Mount Tarawera's violent 1886 eruption was an exception. Andesitic eruptions tend to form steep stratovolcanoes, including mountains such as Ruapehu, Tongariro and Taranaki, islands such as Little Barrier, Whakaari / White and Raoul Islands, or submarine seamounts like Monowai Seamount. Rhyolitic eruptions with large amounts of water tend to cause violent eruptions, producing calderas, such as Lake Taupō and Lake Rotorua. New Zealand also has many volcanoes which are not clearly related to present plate subduction including the extinct Dunedin Volcano and Banks Peninsula, and the dormant Auckland volcanic field.

Extinct volcanoes

The South Island has no currently active volcanoes. However, in the late Cretaceous (100–65 Ma), there was widespread volcanic activity in Marlborough, West Coast, Canterbury and Otago which contributes to landforms such as Mount Somers. In Eocene times (40 Ma), there was volcanic field activity near present day Oamaru. The most well known Miocene volcanic centres are the intra-plate Dunedin Volcano and Banks Peninsulas. The Dunedin Volcano which later eroded to form Otago Peninsula near Dunedin was built up by a series of mainly basaltic intra-plate volcanic eruptions in Miocene times (16–10 Ma). Banks Peninsula near Christchurch was built from two mainly basaltic intra-plate volcanoes in Miocene times (12–6 Ma and 9.5–7.5 Ma), corresponding to the Lyttelton / Whakaraupo and Akaroa Harbours. Southland's Solander Islands / Hautere were active as recently as 150,000 years old. There are also minor volcanics from a similar time period throughout Canterbury, Otago and also on the Chatham Islands.

Intra-plate basaltic volcanic eruptions also occurred in the North Island, near the Bay of Islands in Northland, in the Late Miocene (10 Ma), and again more recently (0.5 Ma). The South Auckland volcanic field was active in Pleistocene times (1.5–0.5 Ma). The Auckland volcanic field started erupting around 250,000 years ago. It includes around 50 distinct eruptions, with most of the prominent cones formed in the last 30,000 years, and the most recent eruption, which formed Rangitoto Island, around 600 years ago. The field is currently dormant and further eruptions are expected. Over time the volcanic field has slowly been drifting northwards.