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.

Pre-Hardmode
As soon as Hardmode begins, The Hallow will appear, and both it and the Corruption/Crimson will spread rapidly. So, before you switch to Hardmode, it is easier for you to contain the Corruption/Crimson first. The simplest step, and often the first, is to dig a tunnel 6 blocks wide completely surrounding the generated Corruption/Crimson areas.

If you wish to go a step further than merely containing the Corruption/Crimson, you can consider buying Purification Powder and cleansing it. On a Small World, you'll need about 12,000 bags, at a total cost of ( each). If you don't have that, 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. Although cleansing a Small World will take about ten hours of your time, you will also be exploring and killing monsters, and might find that fun, and might find some nifty drops.

To prepare yourself for Hardmode even more, you should fish up an abundance of Crates so that when you open them after Hardmode begins you should find some Hardmode ores.

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 with 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 a material that cannot be corrupted (wood,Clay, etc) Then you make an entrance somewhere and enjoy your safe piece of a biome!

You should also explore enough of the world so there are no huge, unexplored areas. Despite your best efforts, small pockets of Corruption/Crimson will spawn anyway after Hardmode begins, and you want to notice them before the infected area gets too big.

Details

 * Crimson and Corruption can spread to grass-covered dirt and thorny bushes up to three tiles away in any direction. Any tiles between the source block and target corruptible block are ignored, including neutral non-corruptible blocks like clay, snow, wood, or empty space. It should be noted that Crimson vines do not spread Crimson pre-hardmode.
 * 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 clay 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.

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/Reaver Shark 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, there is a chance 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.

Details

 * Both the Hallow and Corruption cannot convert each other. So corruption surrounded by hallow will not spread, and likewise the other way around. 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 clay, snow, wood, or empty space.
 * Vines, which grow from grass-covered dirt in the surface layer, can grow 10 tiles downward. Crimson and Hallow vines will spread Crimson and Hallow respectively, if the vines contact corruptible blocks below. Vines are destroyed when the Corruption spreads to their blocks (there are no Corrupt vines).
 * Thorns, just like in pre-Hardmode, 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 (a total of 9 tiles from the grass). Their spread can be contained by limiting grass or even placing physical neutral barriers, like clay 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. Another option is to dig a non-grass lined 3 tile wide hellevator on either side of your jungle. Grass of any kind will allow Thorny bushes to cross any gap that is smaller than 9 tiles, so the sides of the hellevator should be lined with another material. Stone is fine for the lining as it can never grow thorns, even if covered in moss or converted. Even if there is no nearby grass, dirt should be avoided in case of an accident.
 * 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.
 * When Plantera is defeated, the Corruption/Crimson and Hallow spread will be slowed down to 33% of their speed.

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 things such as 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. The Clentaminator also produces a decent amount of light that can completely go through blocks, this allows you to completely map out your world, as well as completely purify it.

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