Many biological systems respond to the presence or absence of gravity. Since experiments performed in space are expensive and can only be undertaken infrequently, Earth-based simulation techniques are used to investigate the biological response to weightlessness. A high gradient magnetic field can be used to levitate a biological organism so that its net weight is zero.We have used a superconducting magnet to assess the effect of diamagnetic levitation on the fruit fly D. melanogaster in levitation experiments that proceeded for up to 22 consecutive days. We have compared the results with those of similar experiments performed in another paradigm for microgravity simulation, the Random Positioning Machine (RPM). We observed a delay in the development of the fruit flies from embryo to adult. Microarray analysis indicated changes in overall gene expression of imagoes that developed from larvae under diamagnetic levitation, and also under simulated hypergravity conditions. Significant changes were observed in the expression of immune-, stress-, and temperature-response genes. For example, several heat shock proteins were affected. We also found that a strong magnetic field, of 16.5 Tesla, had a significant effect on the expression of these genes, independent of the effects associated with magnetically-induced levitation and hypergravity.Diamagnetic levitation can be used to simulate an altered effective gravity environment in which gene expression is tuned differentially in diverse Drosophila melanogaster populations including those of different age and gender. Exposure to the magnetic field per se induced similar, but weaker, changes in gene expression.