ABSTRACT Electromagnetic fundamental and harmonic emission is ubiquitously observed throughout the heliosphere, and in particular it is commonly associated with the occurrence of type II and III solar radio bursts. Classical analytic calculations for the plasma-emission process, though useful, are limited to idealized situations; a conclusive numerical verification of this theory is still lacking, with earlier studies often providing contradicting results on e.g. the precise parameter space in which fundamental and harmonic emission can be produced. To accurately capture the chain of mechanisms underlying plasma emission – from precursor plasma processes to the generation of electromagnetic waves over long times – we perform large scale, first-principles simulations of beam–plasma instabilities. By employing a very large number of computational particles we achieve very low numerical noise, and explore (with an array of simulations) a wide parameter space determined by the beam–plasma density ratio and the ion-to-electron temperature ratio. In particular, we observe direct evidence of both fundamental and harmonic plasma emission when the beam-to-background density ratio ≤0.005 (with beam-to-background energy ratio ∼0.5), tightly constraining this threshold. We observe that, asymptotically, in this regime $\sim 0.1~{{\ \rm per\ cent}}$ of the initial beam energy is converted into harmonic emission, and $\sim 0.001~{{\ \rm per\ cent}}$ into fundamental emission. In contrast with previous studies, we also find that this emission is independent of the ion-to-electron temperature ratio. In addition, we report the direct detection of third-harmonic emission in all of our simulations, at power levels compatible with observations. Our findings have important consequences for understanding the viable conditions leading to plasma emission in space systems, and for the interpretation of observed electromagnetic signals throughout the heliosphere.