In protoplanetary disks around young stars, magnetic fields play an important role for disk evolution and planet formation [1-3]. Polarized thermal emission from magnetically aligned grains is one of the reliable methods to trace magnetic fields [4,5]. However, it has been difficult to observe magnetic field by dust polarization in protoplanetary disks because other polarization mechanisms involving grown dust grains become efficient [6,7,8]. Here, we report muti-wavelengths (0.87 mm, 1.3 mm, 2.1 mm, and 2.7 mm) observations of polarized thermal emission in the protoplanetary disk around HD 142527 that shows the lopsided dust distribution [9,10,11,12]. We revealed that the smaller dust still exhibits magnetic alignment in the southern part of the disk. Furthermore, angular offsets between the observed magnetic field and the disk azimuthal direction were discovered, which can be used for a novel approach to measure the relative strengths of each component (radial (Br), azimuthal (B∅), and vertical (Bz)) of 3D magnetic field. Applying this method, we, for the first time, derived the magnetic field around a 200-au radius from the protostar as |Br|:|B∅ |:|Bz| ~ 0.26±0.01:1:0.23±0.03 and a strength of ~ 0.3 milli Gauss. Our observations provide some key parameters of magnetic activities including the plasma beta, which have been only assumed in theoretical studies. In addition, the radial and vertical angular momentum transfer show comparable, which poses a challenge to theoretical studies of protoplanetary disks.