In this paper, we study the effects of external electric field and Al content on the transverse and longitudinal g-factor (g┴ and g//) and its anisotropy (δg) of wurtzite AlGaN/GaN quantum wells (QWs). The Δg┴=(g┴-g0)=g┴bulk + gw and Δg//=(g//-g0)=g//bulk are mainly contributed by the bulk structure (g//bulk and g┴bulk) respectively, but the difference between g//bulk and g┴bulk is small and almost remains unchanged when the external electric field and Al content are varied. So the anisotropy of the g factor in AlGaN/GaN QWs induced by the bulk wurtzite structure is small, while the anisotropy induced by the quantum confined effect (gw) is considerable. When the direction of the external electric field is the same as (opposite to) the polarization electric field, the magnitudes of g//bulk and g┴bulk both increase (decrease) with increasing external electric field. This is induced mainly by the variations of envelope function and confined energy with the electric field. With the external electric field changing from -1.5×108 V·m-1 to 1.5×108 V· m-1, the confined energy ε1 increases slowly, and the magnitude of the envelope function at the left heterointerface increases. So the contribution to Δg┴ from the heterointerface ΓInter is positive and increases slowly, and that from the well ΓW is negative and increases slowly in magnitude. The magnitude of ΓInter is larger than that of ΓW, but the magnitude of the latter increases more rapidly. All the above factors make the g-factor anisotropy δg>0 and decrease in magnitude with electric field increasing. With increasing Al content of the barrier, both β>1 (g┴bulk) and γ>1 (g//bulk) decrease if the strain effects are ignored (S1, 2=0), because the confined energy decreases and the peak of the envelope function shifts towards the left heterointerface. By considering the strain effects (S1, 2 ≠ 0), the magnitude of β>1 (g┴bulk) and γ>1 (g//bulk) increase with Al content increasing. The strain effect has a great influence on the confined potential V(z), leading to the rapid increase of β(z) when z > zp, which the situation for γ (z) is similar to. With increasing Al content, the magnitudes of ΓInter and ΓW both increase, but the magnitude of ΓInter is larger and increases more rapidly. Therefore δg increases slowly. The magnitude of Δ g┴ first decreases with increasing Al content, then it increases with Al content increasing, and since g┴bulk g-factor and its anisotropy in AlGaN/GaN QWs can be greatly modulated by the external electric field, the Al content in the barrier, the strain effects and the quantum confined effect. Results obtained here are of great importance for designing the spintronic devices.