Guide:Maintaining world purity

Prior to the activation of Hardmode, which is activated by defeating the Wall of Flesh, there lie only a few, relatively small areas of Corruption (or Crimson) on a world. However, once Hardmode is activated, two large strips of both Hallow and Corruption/Crimson appear cutting through the entire world diagonally, reaching from the Underworld to even Sky Islands in its path. Not only that, but the Hallow and Corruption/Crimson generated (as well as existing areas) will spread rapidly through any grass, sand, and stone nearby, and given enough time, both can consume the whole map.

Dealing with the strips that generate upon defeating the Wall of Flesh would be difficult and time consuming on its own, but to get the hardmode ores you would have to indirectly help the spread. Upon smashing a Demon/Crimson altar with the Pwnhammer (Or more powerful tools later on in the game), there is a chance of a single block of your world turning Hallowed or Corrupt/Crimson in a random place, which given enough time, will spread to form new, large areas to deal with.

Corruption/Crimson
In Hardmode, the corruption/crimson spreads far more rapidly; it will corrupt everything in its path except for hallow and non-corruptible blocks, such as wood and bricks. It also has the potential to utterly destroy jungles and underground jungles because corrupt grass transforms mud into dirt, onto which jungle grass cannot grow. However, the spread slows down to 33% of the Hardmode speed after killing Plantera.

The Hallow
Despite its friendly looks, the Hallow is only slightly less dangerous than the Corruption or Crimson. It spreads almost completely in the same way as the Corruption except that it cannot spread through the Jungle. Because of this, many players consider it the "light" Corruption. However, if you do not want to take action for keeping your base pure, Hallow is a better choice than Corruption/Crimson, so you may want to plant some Hallowed Seeds. The Hallow does not uproot or prevent native forest plants from growing, nor does it prevent NPCs from moving in as opposed by the Corruption/Crimson.

Details

 * Both the Hallow and Corruption cannot convert each other. So corruption surrounded by hallow will not spread, and likewise the other way around. However, Hallowed grass will take over Crimson grass, but still stops at Crimstone.
 * Crimson, Corruption, and Hallow can spread to another corruptible block up to three tiles away in any direction. Blocks that can be converted are grass, stone, sand (including Sandstone Block and Hardened Sand Block), ice, and thorns.  Any tiles between the source block and target corruptible block are ignored, including neutral non-corruptible blocks like dirt, snow, wood, or empty space.
 * Thorns can grow from crimson, corrupt, or jungle grass. Corrupt and crimson variants can grow 6 tiles in all directions, and spread corruption or crimson up to three blocks away like any other source, but their spread can be contained with physical neutral barriers, like dirt or wood.  Jungle thorns can spread into range of corruption, become corrupted, and spread further corruption into jungle.  Left unchecked, thorns can inadvertently spread corruption across otherwise safe gaps.
 * If you wish to save your Jungle, spreading Hallow around it as a barrier will prevent it from being corrupted.
 * The Dungeon can completely prevent the spread of Hallow and Corruption/Crimson if it reaches down to the Underworld. If it doesn't reach that far, it will at least slow it down.
 * Floating Islands CAN be turned Hallowed or Corrupted during the initial generation from Hardmode, or if converted blocks are placed near them.
 * The Hallow can convert straight to Corruption by the Corruptor's Vile Spit projectile.
 * When Plantera is defeated, the Corruption/Crimson and Hallow spread will be slowed down to 33% of their speed.

Pre-Hardmode
Because the Corruption/Crimson and Hallow will spread rapidly as soon as Hardmode begins, it's advisable to start containing them beforehand. The simplest step, and often the first, is to dig a 5 block tunnel (or more to be safe) completely surrounding the generated Corrupt/Crimson areas. If you wish to go a step further, you can aim towards blotting out the initial Corruption/Crimson entirely. Buy lots of Purification Powder, head to the infected area, and begin cleansing. Each bag of powder can clean up to 48 blocks. Unless you're extremely meticulous, you're more than likely to miss a few corrupt/crimson blocks, so keep an eye out for their spread once Hardmode begins. If you are running low on money, you can mine the purified Ebonstone/Crimstone, make statues with it, and then sell the statues. You'll also run into plenty of enemies while cleansing, providing some profit. If you're still low on funds, see the guide on making money for more information on getting money. To prepare yourself for Hardmode even more, you should fish up an abundance of Crates and stockpile them for later.

Also it might be worth making safe zones in your map, Safe zones will be areas that are 99.9% safe from any corruption (Only when smashing demon altar there is a small chance that it will corrupt your safe zone (chance increases as safe zone size) First: you make a 6 wide tunnel around the area you want to be safe. Second: You make sure the last 3 tunnel spaces will be filled with an material that cannot be corrupted (wood,Clay, etc) Then you make an entrance somewhere and enjoy your safe piece of a biome!

Hardmode
As soon as the Wall of Flesh is taken down, two diagonal strips of Hallow and Corruption/Crimson will generate in a V shape. The location of these strips and distance between them is completely random; but if you've done a lot of previous underground exploring, the affected areas will be very clear. These diagonal strips will begin spreading as soon as they appear, so they can create a mess if left unattended. However tempting as it may seem, instantly rushing in to stop this spread is a terrible idea; the new Hardmode enemies can easily kill even the most well-armed Pre-Hardmode player, and the Molten Pickaxe you likely have is extremely unfit for mining quickly. Instead, you should devote some time to gearing-up for the task ahead.

Although you may want to head to the Corruption/Crimson and smash all the Demon Altars/Crimson Altars you can find, doing so would be another poor choice; every time an altar is broken, it will generate a single block of Hallow or Corruption/Crimson, which will almost always begin to spread out of control. To make matters worse, finding this singular converted block is all but impossible, until it spreads a large amount. To avoid this, try to keep the amount of smashed altars to a minimum. If you've stockpiled a large amount of Crates before Hardmode, you can open them instead, even if they were fished up before Hardmode. Crates have a chance of containing Hardmode ores if opened during Hardmode. If you haven't done any Crate fishing, you should probably smash altars, as fishing can be a time-consuming process, and time is of the essence when dealing with Hallow and Corruption/Crimson. It's worth mentioning that you can always generate a new world and use your same character to fish in that new world, if you want to acquire additional crates without causing the Hallow and Crimson/Corruption to spread. Make at least a set of Mythril Armor, and a Mythril Drill or Pickaxe, and head to the next step.

With better armor and a faster pickaxe, dealing with the spread of Hallow and Corruption/Crimson should be relatively simple. An effective way is to dig four diagonal, 3-block tunnels surrounding the Hallow and the Corruption/Crimson. If the Hallow strip is generated in the jungle, you don't have to worry about containing it, as the Hallow cannot spread through Mud Blocks. A less time-consuming way is to dig a couple of 3-block shafts directly downward, although this is far less precise. You should also search for the infected areas generated from breaking altars, and contain them before they become out-of-hand.

Complete Conversion
If you want to make cleansing your entire world a feasible task, you will need the Clentaminator. After containing all the Hallow or Corruption/Crimson, defeat a mechanical boss, and the Steampunker will arrive, selling the Clentaminator and its Ammo. Break the Hallow/Corruption/Crimson into manageable portions separated by three (or more) block gaps, and spray them with Green Solution. Later, check on your minimap to find any infected blocks you may have missed, and wipe them out.

The most foolproof way to completely convert or purify your world is to make multiple Hellevators every 116 blocks, then glide down each one using Wings or Feather Falling, while spraying both sides. A drawback to using the Green Solution is that all the Mushroom biomes will be converted into Jungles. An easy fix for this is to go back to each pocket of former Mushrooms and spray it with Dark Blue Solution from the Truffle. Because the Clentaminator also produces a decent amount of light that can completely go through blocks, you may want to make Hellevators every 80 blocks instead to completely map out your world.

If you don't want to destroy your world with Hellevators, you can use Rod of Discord with Clentaminator to clean your world.