Tutorials/Iron golem farming

Iron golem farming uses village mechanics to produce iron, as well as byproducts such as poppies and string. Usually, an iron golem farm is a player-constructed village in which golems are spawned and then either killed immediately, or moved to a holding cell outside the village boundary for later killing.

Overall spawning requirements
An iron golem needs an available volume in which to spawn. There must be at least 3 transparent blocks (preferably air, not other transparent blocks like glass) above the spawning surface, which must be solid and flat (but not a slab).

Java Edition
In Java Edition, a villager may attempt to spawn an iron golem after "talking" to 10 other villagers. The villagers must have access to their workspace and have slept before the golem will spawn, however.

Iron golems can spawn when non-nitwit villagers who have slept in beds gossip five times about needing a golem at a gathering point, and four other villagers are within 80 blocks. Once these conditions are met, an iron golem can spawn in a 16×6×16 area centered on the location of the villager who spread the gossip.

Bedrock Edition
In Bedrock Edition, villagers are not required to sleep or have a workstation in order to spawn iron golems. For an iron golem to spawn, the following conditions must be met: The spawn rate doesn't appear to be affected significantly by increasing the number of beds or villagers.
 * The village has at least 21 beds
 * The village has at least 10 villagers, each of whom has claimed a bed

An iron golem needs a solid flat surface on which to spawn, with at least three transparent blocks above. The spawn surface can exist between 3 blocks below a bed to even with a bed. The feet of the iron golem will spawn on that surface (although in 1.11 there is a bug that sometimes causes golems to spawn stuck in the ground with its head visible above ground).
 * Vertical spawn volume

If beds are placed 3 or more blocks above ground, iron golems cannot spawn on the ground; a spawning surface is needed within the 4-block vertical extent of the spawning region.

Iron golems can spawn on a valid surface extending 8 blocks in any direction from any bed.
 * Horizontal spawn volume

In Bedrock Edition 1.11.1, the probability isn't uniform around the beds. Only 10% of the iron golems will spawn toward the east (including northeast and southeast). The other 90% will spawn in all other directions, with about 70% of the spawns in the west, south, and southwest. If you want to build access to your farm in survival mode, or provide a way for villagers to go in and out, the east side is the best place to do this.

Legacy Console Edition
Iron golem farms in Legacy Console Edition (as well as Java and Bedrock before the Village & Pillage update), are based on doors. Iron golems spawn in a 16×6×16 volume centered on the geometric center of at least 21 doors with at least 10 villagers nearby.

Java Edition videos

 * WeirdWilliam's Iron Farm 1.14

Minimalist farm that can be built in survival mode and is expandable.
 * Avomance's Compact Iron Farm 1.14


 * DocM's Iron Farm

Bedrock Edition videos
These videos describe working farms, but do not accurately represent the iron golem spawning mechanics as they exist in Bedrock Edition 1.11.