Hydrogen peroxide can be used to kill gnats, but it is not as effective as isopropyl alcohol. Mix one part hydrogen peroxide with four parts water and spray the mixture on the gnats. However, it is important to note that hydrogen peroxide can also harm your plants, so use it with caution.