The magnetocrystalline contribution to magnetic anisotropy was studied in the canted antiferromagnetic state of layered Sr2IrO4 single crystals. We performed torque measurements in magnetic fields up to 9 T under various magnetic field orientations. The strong dependence of torque on the magnetic field revealed that the magnetic easy axis is along the in-plane direction and that the observed field-induced weak ferromagnetic order is attributed only to the in-plane component of the external magnetic field. The dependence of torque on the angle produces a twofold symmetric sawtoothlike shape. A simple model consisting of canted antiferromagnetic and magnetic induction terms showed good agreement with the measured torque. These results show that magnetic anisotropy is closely related to the anisotropy of the exchange between antiferromagnetic moments whose canting is mediated by the Dzyaloshinsky-Moriya interaction. Our study demonstrates that torque magnetometry can be extended to the investigation of the magnetic anisotropy of complex magnetic phases.