Soft hydrogels serving as substrates for cell attachment are used to culture many types of cells. The mechanical properties of these gels influence cell morphology, growth, and differentiation. For studies of cell growth on inhomogeneous gels, techniques by which the mechanical properties of the substrate can be measured within the proximity of a given cell are of interest. We describe an apparatus that allows the determination of local gel elasticity by measuring the response of embedded micron-sized magnetic needles to applied magnetic fields. This microscope-based four-magnet apparatus can apply both force and torque on the microneedles. The force and the torque are manipulated by changing the values of the magnetic field at the four poles of the magnet using a feedback circuit driven by LABVIEW . Using Hall probes, we have mapped out the magnetic field and field gradients produced by each pole when all the other poles are held at zero magnetic field. We have verified that superposition of these field maps allows one to obtain field maps for the case when the poles are held at arbitrary field values. This allows one to apply known fields and field gradients to a given microneedle. An imaging system is employed to measure the displacement and rotation of the needles. Polyacrylamide hydrogels of known elasticity were used to determine the relationship between the field gradient at the location of the needles and the force acting on the needles. This relationship allows the force on the microneedle to be determined from a known field gradient. This together with a measurement of the displacement of the needle in a given gel allows one to determine the stiffness of the gel and the elastic modulus, provided Poison’s ratio is known. Using this method, the stiffness and the modulus of elasticity of type-I collagen gels were found to be and , respectively. This apparatus is presently being employed to track the mechanical stiffness of the DNA-cross-linked hydrogels, developed by our group, whose mechanical properties can be varied on demand by adding or removing cross-linker strands. Thus a system that can be utilized to track the local properties of soft media as a function of time with minimum mechanical disturbance in the presence of cells is presented.