What is the formula for calculating odds ratio?

The formula can be given as:

OR_{X_{1}, X_{2}} = e^{\sum_{i=1}^{k} \beta_{i}(X_{1i} - X_{0i}) }

In the formula above, X1 and X0 stand for two different groups for which the odds ratio needs to be calculated. X1i stands for the instance ‘i’ in group X1. Xoi stands for the instance ‘i’ in group X0.β0 stands for the coefficient of the logistic regression model. Note that the baseline is not included in this formula.