Strain gradient theory is an accurate model for capturing the size effect and localization phenomena. However, the challenge in identification of corresponding constitutive parameters limits the practical application of the 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. We make all of the codes publicly available in order to encourage a transparent scientific exchange