The Catch Rate Formula
Chance = Ball (((TotalHP x 4 - CurrentHP x 2) x CatchRate)/ TotalHP)+Status +1
This seems long, but it's very logical. The Ball value is a particular number that each type of PokéBall has. For more info, see the list below.
The Total HP is the max amount of HP the opponent has and the Current HP is the amount of HP it has when you attempt to catch it. Since the game doesn't show the enemy's HP when you battle it, you can only make educated estimates on these numbers.
The CatchRate is a number assigned to each Pokémon that shows how easy or hard it is to catch. More on this is explained below.
If you inflict the opponent with a status effect, the Status value will be calculated. Freeze and Sleep have a value of 10, while Paralysis, Poison, and Burn have a value of 5.
PokéBall Values
The higher the value of the Ball, the more successful it will be in catching a Pokémon.
Ball Value
Poké Ball 1
Great Ball 1.5
Ultra Ball 2
Master Ball Always catches Pokémon
Safari Ball 1.5
Dive Ball 3.5 if underwater
1 if not underwater
Luxury Ball 1
Premier Ball 1
Net Ball 3 if opponent is Bug or Water type
1 if opponent is not
Nest Ball 3 if opponent is between lv. 1-19
2 if opponent is between lv. 20-29
1 if opponent is above lv. 30
Repeat Ball 3 if Pokémon has already been caught
1 if Pokémon has not
Timer Ball 1 if 1-9 turns have passed
2 if 10-19 turns have passed
3 if 20-29 turns have passed
4 if 30+ turns have passed
Catch Rate
All Pokemon are assigned a number which tells how easy or hard that Pokemon is to catch. The lowest number is 3 and the highest is 255. The higher the number, the easier it is to catch.
Pokemon with catch rates above 200 include common, unevolved Pokemon like Zubat, Zigzagoon, and Magikarp.
All legendary Pokemon have catch rates of 3 (except for Kyogre and Groudon, who have catch rates of 5). As you can see, these small numbers are what makes them so hard to catch.
Even Pokemon unobtainable in the wild have catch rates. Almost all of them have the same catch rate of 45, whether it's a Bulbasaur, Blaziken, Umbreon, or even Mew. Since you can't legally catch them in the wild, this doesn't matter, but it will come into play if you use a cheating device to try and catch them in the wild.