This paper presents the detailed implementation and computational aspects of a novel second-order computational homogenization procedure, which is suitable for a multi-scale modelling of macroscopic localization and size effects. The second-order scheme is an extension of the classical (first-order) computational homogenization framework and is based on a proper incorporation of the gradient of the macroscopic deformation gradient tensor into the kinematical macro–micro scale transition. From the microstructural analysis the macroscopic stress and higher-order stress tensors are obtained, thus delivering a microstructurally based constitutive response of the macroscopic second gradient continuum. The higher-order macroscopic constitutive tangents are derived through static condensation of the microscopic global tangent matrix. For the solution of the second gradient equilibrium problem on the macrolevel a mixed finite element formulation is developed. As an example, the second-order computational homogenization approach is applied for the multi-scale analysis of simple shear of a constrained heterogeneous strip, where a pronounced boundary size effect appears.