You need to base the heater choice on how warm you want the water to get.
Take a look though
https://www.thesprucepets.com/aquarium-heater-size-guide-1381033 - especially the table bit,and you should be able to work something out.. I had a decent look over the information and it seemed ok.
One thing to watch for, though, would be having a heater too large... Heaters will occasionally fail. Normally this would be that they do not turn off, or do not turn off.
You need to assume a heater will fail, and if it fails in the on position, it will heat that water as much as it possibly can.
My preference is to have an aquarium with inhabitants that are fine at room temperature, if needing to heat, I will choose 2 good heaters that are rated for half to 2/3 of the volume of water they are going to heat. This is seldom possible with a nano tank.
If you want to heat, 27C should be fine as a top end, so you want to heat 8 gallons (I am assuming US) by 8C. You will likely be fine with a 50W heater.
But, be sure to understand the information yourself, and be sure that all numbers are relevant and appropriate for YOUR locale.