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 (or Crimson) spreads far more rapidly and is no longer stopped by mere sunflowers. It will corrupt everything in its path, besides the Hallow and non-corruptible blocks such as bricks and wood. It also has the potential to utterly destroy the Jungle and Underground Jungle because the "evil grass" will turn Mud into Dirt on which Jungle cannot be regrown.

The Corruption and Crimson are fairly similar and work in the same manner.

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/Crimson cannot convert each other. So corruption surrounded by hallow will not spread, and likewise the other way around. (Tested in 1.2.4.1, Crimson is converted by Hallow; not sure if it is a bug or not.)
 * Neither biome can convert or go through any block except grass, stone, sand, and ice. So digging up a strip of dirt and replacing it with, say, wood would stop its spreading. The grass can spread up to normal grass up to 5 blocks away and the stone, sand, and ice variants can only convert up to three blocks away.
 * 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 to 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 3 block tunnel 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.

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. 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 120 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.