New piezoresistive silicon cantilevers designed specifically for torque magnetometry on microscopic samples have been microfabricated and tested. These levers have been optimized to detect the torque in two directions corresponding to flexion and torsion. Torque resolution of 10 E-14 N m can be achieved depending on the operating mode. In one version an integrated loop allows an absolute calibration of the device with an accuracy of ~1%. This loop can also be used to excite the lever mechanically. One application is the determination of the mass of nanogram samples by measuring the resonance frequency shift (nanobalance).