The following formula is involved in the calculation of Fisher's exact test probability values for a 2x2 contingency table:

Probability for Fisher's exact test:
where a, b, c, and d are the number of observations in each cell of a 2x2 contingency table, and n is the total sample size.

The following references can be used to cite this fisher's exact test calculator for a 2x2 contingency table:
 Soper, D.S. (2014). Fisher's Exact Test Calculator for a 2x2 Contingency Table [Software]. Available from http://www.danielsoper.com/statcalc 
 Fisher, R. A. (1922). On the interpretation of X2 from contingency tables, and the calculation of P. Journal of the Royal Statistical Society, 85(1), pp. 8794. 