Strain gradient theory is an accurate model for capturing size effects and localization phenomena. However, the challenge in identification of corresponding constitutive parameters limits the practical application of such theory. We present and utilize asymptotic homogenization herein. All parameters in rank four, five, and six tensors are determined with the demonstrated computational approach. Examples for epoxy carbon fiber composite, metal matrix composite, and aluminum foam illustrate the effectiveness and versatility of the proposed method. The influences of volume fraction of matrix, the stack of RVEs, and the varying unit cell lengths on the identified parameters are investigated. The homogenization computational tool is applicable to a wide class materials and makes use of open-source codes in FEniCS.