The H‐Kappa (H‐κ) stacking algorithm is an important tool to stack receiver functions and thus help determine crustal thickness (H) and crustal P‐wave to S‐wave velocity ratio (κ). To determine these crustal parameters, the H‐κ stacking algorithm makes use of a direct search method by assuming some reasonable values for weights assigned to three seismic phases found on receiver functions. In this study, genetic algorithms (GAs) have been implemented to investigate and obtain optimal or near optimal values of the weights assigned to the phases. The results indicate that GA is effective in finding weights for determining crustal parameters as it iteratively searches many combinations of weights without being trapped in local optima. Thus, the GA is implemented here to provide optimal weights for a set of receiver functions to be used by the H‐κ stacking algorithm. In order to test the validity of the proposed method, we used receiver function sets from a previous work. We found that the resulting weights from the new method are very close to the weights used in the earlier study and that the H and κ values obtained through the two different studies are consistent. Since no human intervention is required while the GA is searching to obtain the different optimal parameters, the GA‐Hκ technique could be used in automatic determinations of crustal parameters.