We report the discovery of four relatively massive (2-7MJ) transiting extrasolar planets. HAT-P-20b orbits a V=11.339 K3 dwarf star with a period P=2.875317+/-0.000004d. The host star has a mass of 0.760+/-0.03 Msun, radius of 0.690+/-0.02 Rsun, Teff=4595+/-80 K, and metallicity [Fe/H]=+0.35+/-0.08. HAT-P-20b has a mass of 7.246+/-0.187 MJ, and radius of 0.867+/-0.033 RJ yielding a mean density of 13.78+/-1.50 gcm^-3 , which is the second highest value among all known exoplanets. HAT-P-21b orbits a V=11.685 G3 dwarf on an eccentric (e=0.2280+/-0.016) orbit, with a period of P=4.1244810+/-000007d. The host star has a mass of 0.95+/-0.04Msun, radius of 1.10+/-0.08Rsun, Teff=5588+/-80K, and [Fe/H]=+0.01+/-0.08. HAT-P-21b has a mass of 4.063+/-0.161MJ, and radius of 1.024+/-0.092RJ. HAT-P-22b orbits the V=9.732 G5 dwarf HD233731, with P=3.2122200+/-0.000009d. The host star has a mass of 0.92+/-0.03Msun, radius of 1.04+/-0.04Rsun, Teff=5302+/-80K, and metallicity of +0.24+/-0.08. The planet has a mass of 2.147+/-0.061 MJ, and compact radius of 1.080+/-0.058RJ. The host star also harbors an M-dwarf companion at a wide separation. Finally, HAT-P-23b orbits a V=12.432 G0 dwarf star, with a period P=1.212884+/-0.000002d. The host star has a mass of 1.13+/-0.04sun, radius of 1.20+/-0.07Rsun, Teff=5905+/-80K, and [Fe/H]=+0.15+/-0.04. The planetary companion has a mass of 2.090+/-0.111MJ, and radius of 1.368+/-0.090RJ (abridged).