The flora of Madagascar consists of more than 12,000 species of plants, as well as a poorly known number of fungi and algae. Around 83% of Madagascar's vascular plants are found only on the island. These endemics include five plant families, 85% of the over 900 orchid species, around 200 species of palms, and such emblematic species as the traveller's tree, six species of baobab and the Madagascar periwinkle. The high degree of endemism is due to Madagascar's long isolation following its separation from the African and Indian landmasses in the Mesozoic, 150–160 and 84–91 million years ago, respectively. However, few plant lineages remain from the ancient Gondwanan flora; most extant plant groups immigrated via across-ocean dispersal well after continental break-up.

After its continental separation, Madagascar probably experienced a dry period, and tropical rainforest expanded only later in the Oligocene to Miocene when rainfall increased. Today, humid forests, including the lowland forests, are mainly found on the eastern plateau where abundant rainfall from the Indian Ocean is captured by an escarpment. A large part of the central highlands, in the sub-humid forests ecoregion, is today dominated by grasslands. They are widely seen as result of human landscape transformation but some may be more ancient. Grassland occurs in a mosaic with woodland and bushland, including tapia forest, and hard-leaved thickets on the high mountains. Dry forest and succulent woodland are found in the drier western part and grade into the unique spiny thicket in the southwest, where rainfall is lowest and the wet season shortest. Mangroves occur on the west coast, and a variety of wetland habitats with an adapted flora are found across the island.

The first human presence in Madagascar dates only 2000–4000 years back, and settlement in the interior occurred centuries later. The Malagasy people have used the native flora for various purposes, including food, construction, and medicine. Exotic plants were introduced by early settlers, later traders and French colonialists, and many have become important to agriculture. Among them are rice, the staple dish of Malagasy cuisine grown in terraced fields in the highlands, and greater yam, taro, cowpea, and plantain. Plantation crops include litchi, cloves, coffee, and vanilla, the latter one of the country's main export produce today. More than 1,300 introduced plants are known, of which around 600 have become naturalised, and some invasive.

Human population growth and economic activity have put pressure on natural vegetation in the region, especially through massive deforestation. Madagascar's high endemism and species richness coupled with a sharp decrease in primary vegetation make the island a global biodiversity hotspot. To preserve natural habitats, around 10% of the land surface is protected, including the World Heritage sites Tsingy de Bemaraha and the Rainforests of the Atsinanana. While historically mainly European naturalists described Madagascar's flora scientifically, today a number of national and international herbaria, botanical gardens and universities document plant diversity and engage in its conservation.

Diversity and endemism

Madagascar has been described as "one of the most floristically unique places in the world". , 343 families of vascular plants and bryophytes, with roughly 12,000 species, were known according to the Catalogue of the plants of Madagascar. Many plant groups are still insufficiently known. Madagascar is the island with the second-highest number of vascular plants, behind New Guinea. Of the vascular plants, 83% are endemic: they are found only in Madagascar. These endemics include five entire plant families: Asteropeiaceae, Barbeuiaceae, Physenaceae, Sarcolaenaceae and Sphaerosepalaceae. As many as 96% of Madagascan trees and shrubs are estimated to be endemic.

Vascular plants

Among the non-flowering plants, ferns, lycophytes and allies count roughly 570 described species in Madagascar. About half of these are endemic; in the scaly tree fern family Cyatheaceae, native to the humid forests, all but three of 47 species are endemic. Six conifers in genus Podocarpusall endemicand one cycad (Cycas thouarsii), are native to the island.

In the flowering plants, basal groups and magnoliids account for some 320 Madagascan species, around 94% of which are endemic. The families most rich in species are Annonaceae, Lauraceae, Monimiaceae, and Myristicaceae, containing mainly trees, shrubs, and lianas, and the predominantly herbaceous pepper family (Piperaceae).

Monocots are highly diversified. They include Madagascar's most species-rich plant family, the orchids (Orchidaceae), with over 900 species of which 85% are endemic. Palms (Arecaceae) have around 200 species in Madagascar (most in the large genus Dypsis), more than three times as many as in continental Africa; all but five are endemic. Palm genera that are endemic to Madagascar are Beccariophoenix, Bismarckia, Dypsis, Lemurophoenix, Marojejya, Masoala, Ravenea, Satranala, Tahina, and Voanioala.

Other large monocot families include the Pandanaceae with 88 endemic pandan (Pandanus) species, mainly found in humid to wet habitats, and the Asphodelaceae, with most species and over 130 endemics in the succulent genus Aloe. Grasses (Poaceae, around 550 species) and sedges (Cyperaceae, around 300) are species-rich, but have lower levels of endemism (40% and 37%, respectively). The endemic traveller's tree (Ravenala madagascariensis), a national emblem and widely planted, is the sole Madagascan species in the family Strelitziaceae.

The eudicots account for most of Madagascar's plant diversity. Their most species-rich families on the island are: Fabaceae (legumes, 662 species – 77% endemic), accounting for many trees in humid and dry forests, including rosewood; Rubiaceae (coffee family, 632 – 92%), with notably over 100 endemic Psychotria and 60 endemic Coffea species; Asteraceae (composite family, 535 – 81%), with over 100 endemic species in Helichrysum; Acanthaceae (acanthus family, 500 – 94%), with 90 endemic species in Hypoestes; Euphorbiaceae (spurge family, 459 – 94%), notably the large genera Croton and Euphorbia; Malvaceae (mallows, 486 – 87%), including the large genus Dombeya (17797%) and seven out of nine baobabs (Adansonia), of which six are endemic; Apocynaceae (dogbane family, 363 – 93%), including the Madagascar periwinkle (Catharanthus roseus); Melastomataceae (melastomes, 341 – 98%), mainly trees and shrubs.

Non-vascular plants

A checklist from 2012 records 751 moss species and infraspecific taxa, 390 liverworts, and three hornworts. About 34% of the mosses and 19% of the liverworts are endemic. It is unknown how many of these species may have gone extinct since their discovery, and a number likely remain to be described.

Fungi

Many undescribed species of fungi are suspected in Madagascar. A number of edible mushrooms are consumed in the country, especially from the genera Auricularia, Lepiota, Cantharellus (the chanterelles), and Russula (the brittlegills). Most of the ectomycorrhizal species are found in plantations of introduced eucalyptus and pine, but also in native tapia (Uapaca bojeri) woodlands. The chytrid fungus Batrachochytrium dendrobatidis, responsible for chytridiomycosis, an infectious disease threatening amphibian populations worldwide, was long considered absent from Madagascar. In 2010 it was recorded, however, and has been confirmed since in various areas and in numerous frog families, alerting scientists to a new threat to the island's already endangered frog fauna.

Over 500 species of lichens of Madagascar have been documented, but the true number was estimated to be at least twice as high. Wet tropical areas of siliceous bedrock make up approximately two-thirds of the country, and are where most of the lichens have been found. Dry tropical areas of granitic and limestone bedrock make up the other one-third of the country with just over 20 species documented in these habitats.

Algae

Algae, a diverse group of non-plant photosynthetic organisms, are in general poorly known in Madagascar. A review of freshwater diatoms listed 134 species; most of them have been described from fossil deposits and it is unknown if they have become extinct. It is assumed that Madagascar harbours a rich endemic diatom flora. Diatom deposits from lake sediments have been used to reconstruct paleoclimatic variations on the island.

Vegetation types

Madagascar features contrasting and unique vegetation types, determined mainly by topography, climate, and geology. A steep eastern escarpment captures most of the rainfall brought by trade winds from the Indian Ocean. Consequently, the eastern belt harbours most of the humid forests, while the west has a drier vegetation. The rain shadow region in the southwest has a sub-arid climate. The central highlands, above , feature some high mountains, though the Tsaratanana Massif in the north has the highest elevation, namely . Temperatures are highest on the west coast, with annual means of up to , while the high massifs have a cool climate with a annual mean. The geology of Madagascar features mainly igneous and metamorphic basement rocks, with some lava and quartzite in the central and eastern plateaus, while the western part has belts of sandstone, limestone (including the tsingy formations), and unconsolidated sand.

The marked east–central–west distinction among Madagascan flora was already described by the English naturalist Richard Baron in 1889. Twentieth-century authors, including Henri Perrier de la Bâthie and Henri Humbert, built upon this concept and proposed several similar classification systems, based on floristic and structural criteria. A classification from 2007, the Atlas of the vegetation of Madagascar, distinguishes 15 vegetation types (including two degraded types and cultivation) based on satellite imagery and ground surveys; they are defined mainly based on vegetation structure and differ in species composition in different parts of the island. They partly correspond to the seven terrestrial ecoregions defined by the World Wildlife Fund (WWF) in Madagascar.

Humid forests

Tropical rainforest was estimated to cover around 8% of the island in 2007, but used to encompass more than twice as much. The ecoregion ranges from sea level to elevation and is mainly found on the eastern plateaus, on basement rocks with lateritic soils. In the north, humid forest extends west to the Sambirano river basin and islands including Nosy Be. Annual rainfall is up to in areas such as Masoala Peninsulaand the dry season is short or absent. The predominantly evergreen forest, up to , is composed of tree and understory species from various families such as Burseraceae, Ebenaceae, Fabaceae, and Myristicaceae; bamboos and lianas are frequent. Cyclones hit the east coast of Madagascar in some years and can destroy habitats. The WWF classifies the eastern belt of humid forest, below elevation, in the "lowland forests" ecoregion and the montane forests of the highlands in the "sub-humid forests" ecoregion.

Degraded humid forest (savoka in Malagasy) covers about ten percent of the island. It spans various states of degradation and is composed of forest remnants and planted or otherwise introduced species. It is primarily the result of slash-and-burn cultivation in primary forest. Some forest fragments still harbour a considerable amount of biodiversity.