Margaret Levyns was initially educated at home by her mother and later attended Ellerslie Girls' School. She obtained a first class matriculation and was awarded two bursaries. In 1908 she enrolled at the South African College intending to study mathematics, geology and chemistry, with botany for her honours year. Prof. Harold Pearson persuaded her to take botany as a major subject. After winning two scholarships, the Queen Victoria Scholarship and the 1851 Exhibition Memorial Scholarship and spending 1912-14 at Newnham College, she returned to South Africa and was promptly awarded another scholarship to the John Innes Institute where she chose to study genetics. On returning to South Africa for the second time, she took up a lecturing post in the Botany Department at the South African College which later became the University of Cape Town. She was the first woman to receive a D.Sc. degree from University of Cape Town, for her 1932 thesis 'A taxonomic study of Lobostemon and Echiostachys'. Her publications included A Guide to the Flora of the Cape Peninsula in 1929, and substantial sections of Flora of the Cape Peninsula by Adamson & Salter in 1950.
After her retirement in 1945, she remained active in the botanical field and published numerous papers on taxonomy and phytogeography. She revised a number of South African genera e.g. Muraltia. In 1923 she married John Levyns, later Assistant Provincial Secretary of the Cape Province and who served on the council of the Botanical Society of South Africa.
Margaret Levyns is commemorated in Thamnochortus levynsiae Pillans, Nivenia levynsiae H. Weimarck and Crassula levynsiae Adamson. Some 12 000 of her collected specimens are lodged with BOL, CT, PRE, K and other herbaria. This botanist is denoted by the author abbreviation Levyns when citing a botanical name.