It is always frustrating for guitar players to get the G string in tune because it seems to be always out of tune. Several causes lead to sharp G string and we'll talk about these possibilities so that you can check and know how to fix them.
Why Always Sharp G String
Headstock Design
On guitar headstock, for example, those with 3R+3L tuning placement, the D and G strings are at a slight angle compared to the other strings. This adds some pressure and tension to the guitar strings, so the G string gets out of tune.
Nut Slot
The friction between a nut slot and a string is actually what can cause a majority of tuning problems. Every time a string is bent, it's moving in the nut slot. That friction changes the tension of the string and is what ultimately changes the pitch. To minimize those changes in tension, you can lubricate or add pencil lead and reduce the friction.
Unwounded String
If you notice your low E, A, and D strings on your guitar, they are most likely wound and thicker, while your thinner G, B, and high E strings are most likely unwound. It would be more comfortable for bending your G, B, and high E strings, thus they are out of tune easily.
Some Other General Reasons
String Tension
Your strings have tension, that's why they can be hit and produce different yet beautiful sounds, and this tension will pull them from where they were. Stretching the strings prior to installing might be a good way to slow the strings from getting out of tune.
Broken Tuning Machines
Check whether the tuning pegs on your guitar headstock are broken and can't hold the string tight. If they wear out, you can buy some new replacement tuning machines online.
Set Up Improperly
Maybe your guitar hasn't got a proper setup in the first place. Poor intonation can affect much more than just an open string being out of tune as chords and even single note lines can fall flat or sharp.
Old Strings
If your strings are old and worn off, it gets out of tune easily. Just take it down and change it with a new one.