The percentage of gold/elixir that can be stolen from storages is 20% and is capped at 198k. This means that if more than 992k is being held in storages, it is subject to the cap.
The percentage of gold/elixir that can be stolen from mines/collectors is 50% and is capped only by the storage capacity of the mine/collector.
There is an additional 1k of each resource that can be stolen inside the Town Hall.
Therefore, calculated loot = (20% x stored resources, up to 198k) + (50% x amount in mines/collectors) + 1k.
This means that the maximum calculated loot, for each resource, that can be stolen from 1 opponent (with maxxed mines/collectors and full storages) is: 198k + (7 x 75k) + 1k= 724k.
These figures are BEFORE the multiplier is applied. The multiplier is what is behind the loot "penalty" and the loot "bonus". The amount of AVAILABLE loot= calculated loot x multiplier. The multiplier is determined as follows:
Maximum loot after the multiplier is applied is [(200%) x (198k + 7 x 75k)]+1k = 1.447 million of either gold or elixir. This is, of course, highly unlikely for someone to actually raid, though.
The comprehensive formula for finding available loot is:
(multiplier percentage) x [(20% x storage amount, capped at 198k) +(50% x mine/collector amount) + 1k]=loot
NOTE: The 1k that the TH stores is subject to the PENALTY, but not the BONUS, as 1k is the most it can ever store.
In addition to what is won in battle, there are loot bonuses for being in trophy leagues. Detailed information on that can be found here: http://forum.supercell.net/showthrea...w-Leagues-work
Dark Elixir Loots:
Dark elixir storages have 5% available for raiding and dark elixir drills have 75% available for raiding. The cap for raiding from the storage is 2k, while the drills are raidable according to (75% of uncollected DE) x (loot multiplier) or the maximum capacity of the drill, whichever is lower.
The maximum amount of DE that can be looted from a single raid is: (200% x 2k)+(3 x 1.6k)=8.8k
The formula for dark elixir loots is:
(multiplier percentage) x [(5% x storage amount) + (75% x amount in drill(s))]= loot
The multiplier data is from here: http://forum.supercell.net/showthrea...ot-has-changed
The wiki page with multiplier data is:[http://clashofclans.wikia.com/wiki/Town_Hall#Town_Hall_and_Match_Making http://clashofclans.wikia.com/wiki/Town_Hall#Town_Hall_and_Match_Making]
Wiki page on raiding: http://clashofclans.wikia.com/wiki/Raids#Loot
Here is a web calculator: http://www.clashingtools.com/?
If anyone finds a mistake in the data or has additonal information to add, please leave a comment. I still may need to edit this because of the update, so if anything appears wrong please let me know.
Changes in May (TH 10) Update
Changes in April Update