Gliomas are primary brain tumours that are thought to derive from neuroglial stem or progenitor cells. On the basis of their histological appearance, they have been traditionally classified as astrocytic, oligodendroglial or ependymal tumours and assigned WHO grades I-IV, which indicate different degrees of malignancy. Tremendous progress in genomic, transcriptomic and epigenetic profiling has resulted in new concepts of classifying and treating gliomas. Diffusely infiltrating gliomas in adults are now separated into three overarching tumour groups with distinct natural histories, responses to treatment and outcomes: isocitrate dehydrogenase (IDH)-mutant, 1p/19q co-deleted tumours with mostly oligodendroglial morphology that are associated with the best prognosis; IDH-mutant, 1p/19q non-co-deleted tumours with mostly astrocytic histology that are associated with intermediate outcome; and IDH wild-type, mostly higher WHO grade (III or IV) tumours that are associated with poor prognosis. Gliomas in children are molecularly distinct from those in adults, the majority being WHO grade I pilocytic astrocytomas characterized by circumscribed growth, favourable prognosis and frequent BRAF gene fusions or mutations. Ependymal tumours can be molecularly subdivided into distinct epigenetic subgroups according to location and prognosis. Although surgery, radiotherapy and alkylating agent chemotherapy are still the mainstay of treatment, individually tailored strategies based on tumour-intrinsic dominant signalling pathways and antigenic tumour profiles may ultimately improve outcome. For an illustrated summary of this Primer, visit: http://go.nature.com/TXY7Ri.