Abstract. Gamma-ray bursts (GRBs) have been suggested as possible sources of the highenergy neutrino flux recently detected by the IceCube telescope. We revisit the fireball emission model and elaborate an analytical prescription to estimate the high-energy neutrino prompt emission from pion and kaon decays, assuming that the leading mechanism for the neutrino production is lepto-hadronic. To this purpose, we include hadronic, radiative and adiabatic cooling effects and discuss their relevance for long-(including high-and lowluminosity) and short-duration GRBs. The expected diffuse neutrino background is derived, by requiring that the GRB high-energy neutrino counterparts follow up-to-date gamma-ray luminosity functions and redshift evolutions of the long and short GRBs. Although dedicated stacking searches have been unsuccessful up to now, we find that GRBs could contribute up to a few % to the observed IceCube high-energy neutrino flux for sub-PeV energies, assuming that the latter has a diffuse origin. Gamma-ray bursts, especially low-luminosity ones, could however be the main sources of the IceCube high-energy neutrino flux in the PeV range. While high-luminosity and low-luminosity GRBs have comparable intensities, the contribution from the short-duration component is significantly smaller. Our findings confirm the most-recent IceCube results on the GRB searches and suggest that larger exposure is mandatory to detect high-energy neutrinos from high-luminosity GRBs in the near future.