Hey I know I'm late to answer this question but..
I had this same problem and like you when used headphones the noise got "better".
The thing causing the noise in my computer was actually a dust bunny that was lodged under my mother board. I removed the dust and the noise went away. This was...