Why does my guitar buzz only when plugged in?
If the buzz disappears when you unplug, the problem isn't in the strings, the frets, or the neck — it's electrical. That's actually good news, because it narrows things down fast.
The most common cause: grounding and hum
A steady 60-cycle hum (or buzz that changes when you touch the strings or move near certain lights and electronics) is almost always a grounding issue, or single-coil pickups picking up electromagnetic interference from nearby power sources, fluorescent lighting, dimmer switches, or computer monitors. This isn't a defect exactly — it's physics. Single-coil pickups are inherently more susceptible to this than humbuckers, which are literally designed to cancel out that interference (it's in the name).
Loose hardware and internal connections
Buzz that's more of a rattle than a hum can come from a loose output jack, a cable connection that's not fully seated, a loose pot or switch inside the control cavity, or even a spring in a tremolo system resonating sympathetically. This kind of buzz tends to be intermittent and often changes if you wiggle the cable or tap the guitar's body.
Cable and amp gremlins
Before tearing into the guitar, swap the cable and try a different amp or input if you can. A bad cable or a noisy amp input is a completely different repair than an issue inside the guitar, and it's the fastest thing to rule out.
What to actually do
Isolate: does it happen on all pickup positions or just one? Does it change when you touch the strings (touching should reduce hum if it's a grounding issue)? Does moving away from certain electronics change it? Those answers point toward pickups/grounding versus a loose internal connection, which is worth knowing before you open anything up — or before you bring it in and let someone else do the isolating for you.