Stratification reduces the variance of sample estimates for population parameters by creating homogeneous strata. Often, surveyors stratify the population using the most convenient variables such as age, sex, region, etc. Such convenient methods often do not produce internally homogeneous strata, hence, the precision of the estimates of the variables of interest could be further improved. This paper introduces an R-package called 'stratifyR' whereby it proposes a method for optimal stratication of survey populations for a univariate study variable that follows a particular distribution estimated from a data set that is available to the surveyor. The stratication problem is formulated as a mathematical programming problem and solved by using a dynamic programming technique. Methods for several distributions such as uniform, weibull, gamma, normal, lognormal, exponential, right-triangular, cauchy and pareto are presented. The package is able to construct optimal stratification boundaries (OSB) and calculate optimal sample sizes (OSS) under Neyman allocation. Several examples, using simulated data, are presented to illustrate the stratified designs that can be constructed with the proposed methodology. Results reveal that the proposed method computes OSB that are precise and comparable to the established methods. All the calculations presented in this paper were carried out using the stratifyR package that will be made available on CRAN.