Wrench (tool)
A wrench or, in British English, spanner, is a fastening tool used to manipulate threaded fasteners such as nuts and bolts. The wrench is sized and shaped to put pressure and leverage on flat faces of the fastener, and then is moved in the direction of rotation needed to loosen or tighten the fastening assembly.
The most common hand wrenches either are open-ended, such that they have sides parallel to two or more facets of the nut, or variously called box or socket, which surround all sides of the nut. A box wrench is a hand tool that can drop over the nut no matter how much of the screw or bolt protrudes, while a socket wrench has a maximum depth of shaft that it can accept. The advantage of sockets is that they can be attached to a wide range of drivers, for mechanical power advantage and sometimes simply to reach the nut through a flexible driveshaft.
Socket wrenches and nutdrivers
Sockets proper are single pieces of cast or machined metal, with one end shaped to slip over the fastener to be manipulated, and the other to receive a driveshaft to turn it. The shaft end may actually have a depression, or even a spring-loaded bearing, to help lock the shaft into place. In combination, the driveshaft and socket are extremely strong in rotation, but should separate easily with linear traction.
The most basic driver is a shaft with a handle, much like a screwdriver, but with a socket-mating connector rather than a screwdriver bit. Another very common variant, called an extension, has a male connector that mates with the socket at one end, and a female connector that accepts another socket tool at the other. Multiple extensions can be snapped together for extra length.
Nutdrivers are a permanently attached set of socket, driveshaft, and handle. Some nutdrivers have hollow shafts, so bolt length protruding above the nut goes into the hollow and does not interfere with rotation.
Most often, however, at the end of the extension away from the socket, a tool to improve the leverage of driving is attached. One such tool is a ratchet, which, at first, looks like an open-ended or box wrench. The male connector, however, is attached to a disk and mechanical components inside the ratchet head. There is a small control that selects the direction (i.e., loosening or tightening) in which the socket is to be moved. Once that control is set, the ratchet moves freely in the other direction, so it can be repositioned easily; it is not necessary to have 360 degree access above the fastener -- just enough working space to move the ratchet handle.
Where the English measurement system is used, the shaft diameter is most often 3/8" or 1/4" for general purposes. 1/2", 3/4", and 1" drives are used for heavy equipment. Both metric and English system sockets, however, can snap onto the male end of the shaft.
Torque wrenches
A torque wrench is both a fastening tool and a measuring device. It is used where precise measurement of the tightness of a bolt is necessary.
Spanners (precision)
While a spanner is a general term in British English for "wrench", there is a specialized tool always known as a spanner. It consists of a bar with two or more protruding pins, sometimes adjustable in distance, that fit into corresponding holes in a fastener an allow it to be turned. The bar is connected to a shaft or other mechanism to allow turning, or sometimes the spanner is built not as a bar, but as a pliers-like device with the pins at the work end. Spanners are often used in optical work, on the retaining rings of lens elements.