Socket wrench generator: print a socket for any nut size
What is the socket wrench generator?
This generator makes a socket, also called a nut driver or Steckschlüsselnuss, for hex nuts, 12-point shapes and square nuts of any size from 4 to 46 mm. You enter the size of the nut, choose the drive that fits your ratchet or your hand, set how deep the pocket should be, and the preview shows the finished part immediately. It is meant for the small jobs where a printed tool is simply handy: the odd nut size that is missing from your socket set, a nut on a lamp, a model or a printer frame, a deep recessed nut in a piece of furniture, or a one-off size you will use once. Browse the example gallery to see 14 sockets from 5.5 mm to 27 mm and one in inches.
Please read this first: a printed socket is for light duty only. Think hand-tight nuts on furniture, enclosures, toys and models. It is not for use with an impact wrench, not for wheel nuts, brake parts, bicycles, ladders or any other safety-relevant fastener, and not for breaking loose a stuck or rusted nut. The editor shows this caution above the controls and again in the warnings, together with an estimate of how much torque the weakest wall can carry. That estimate is a rough guide, not a rating.
How the generator works
Everything runs in your browser. Nothing is uploaded and the design is stored in the link, so you can bookmark it or send it to someone. The steps are short: choose the size in the “Nut” section, pick the drive, check the body and the label, and download STL or 3MF. A typical build takes well under a second.
The shape is an original design inspired by the any-size custom socket generator by Shmoee on Printables, an OpenSCAD model that is listed under CC BY 4.0. We took the idea of a parametric socket for any size, not the code or the mesh. See the licenses page for details.
Choosing the nut size
“Nut size (across flats)” is the distance between two parallel faces of the nut, in millimeters. Typical values are 13 mm for an M8 nut, 17 mm for M10 and 19 mm for M12 on DIN 934 nuts, 10 mm for M6 and 7 mm for M4. Above the field you find presets:
| Group | Presets |
|---|---|
| Metric | 5.5, 7, 8, 10, 13, 17, 19, 22, 24, 27, 30, 32, 36 mm |
| Inch | 1/4, 5/16, 3/8, 7/16, 1/2, 9/16, 5/8, 3/4, 7/8, 1, 1 1/8 and 1 1/4 inch |
The field itself accepts 4 to 46 mm in steps of 0.1 mm. If the value matches an inch preset, the automatic label shows the inch size (7/16") instead of 11.1. “Nut shape” offers three pockets. Hex fits normal nuts. 12-point is a hexagon together with a copy turned by 30 degrees, so the nut can slip in at twice as many angles, which helps in tight spots. Square makes a square pocket for square nuts, and the size is then the side length.
Clearance and fit
“Clearance” adds room across the flats, 0.3 mm by default (0 to 1 mm). Too little and the nut will not slide in; too much and the socket rounds the corners of the nut. Below 0.1 mm the editor warns you. “Entrance chamfer” (0 to 3 mm, 0.8 mm by default) widens the top of the pocket at 45 degrees, so you can drop the socket onto a nut without aiming perfectly, and the nut centers itself. It is limited automatically so that at least 1.2 mm of wall stays at the top.
Depth, core, extension and through hole
“Pocket depth” (3 to 50 mm, 10 mm by default) is the part of the socket that surrounds the nut and the bolt behind it. “Wall” (2 to 10 mm, 3.5 mm by default) is the material around the corners of the pocket and sets the outer diameter: for the default 13 mm socket the outside is 22.4 mm. “Core” (1.5 to 8 mm, 2.5 mm by default) is the solid floor between the pocket and the drive opening.
“Extension” (0 to 60 mm) adds length between pocket and drive. Use it for recessed nuts, where the nut sits at the bottom of a hole and a short socket would not reach it. The deep example adds 24 mm and ends up 50 mm tall. “Through hole” (0 to 30 mm) bores a hole through the entire socket, so bolt ends, studs or a threaded rod can stick out through the back. It is limited to leave a seat for the nut, and the roof of the drive recess then runs out into the hole instead of closing to a point.
The drive end
“Drive” has five choices. The three square sizes cut a recess of 6.35, 9.53 or 12.7 mm plus the drive clearance of 0.25 mm, 9, 12 or 15 mm deep. “1/4 inch hex” cuts a hex slot of 6.35 mm across flats and 10 mm deep for a hex bit or an adapter from a cordless drill; a printed socket in a drill chuck is only for very small torques. “By hand” leaves the bottom closed.
The roof of the drive recess is the part that needs care for a support-free print. A flat roof would sag over a 10 mm opening, so the recess closes with a stepped pyramid: each 0.2 mm layer is 0.36 mm narrower across the flats, which is 42 degrees from vertical and well inside the 45 degree rule of thumb. The pyramid adds 3.8 mm of height for a 1/4 inch drive, 5.4 mm for 3/8 and 7.2 mm for 1/2. The opening at the bed also gets a 0.5 mm chamfer, which absorbs the elephant foot so the socket slips over the drive.
The outside and the label
“Outside” offers three forms. Round is the default and the strongest for its weight. Hex makes the outside a hexagon, whose size the editor shows, so you can turn the socket with an open-end wrench, and it is the right choice when there is no room for a ratchet. Knurled adds fine ribs for turning by hand. “Slim body” tapers the body between the drive end and the nut end at 42 degrees if one end is thicker than the other, for example a small 1/4 inch drive on a large 32 mm nut; the core is lengthened automatically if the taper needs the height.
The size is engraved on the side by default, for example 13 or 7/16". Choose “Text” to type your own label of up to 12 characters, pick the font, and set the text size (0 fits the available space, up to 8 mm tall) and the engraving depth (0.4 to 1.5 mm, 0.6 mm by default). The engraving is limited so that at least 1 mm of wall stays under it. The grooves are cut layer by layer, and the top of every stroke slopes at 42 degrees, so the engraving prints without supports too. A knurled outside cannot be engraved; the editor tells you.
Strength: what to expect
A socket is printed standing up, so the layers are rings around the axis. Turning the nut loads the walls in torsion along the layers, which is the strong direction of a printed part. What is weak is the corners: the points of the hexagon pocket and of the square drive concentrate stress, which is why the wall must not be thin. The estimate shown under “Body” treats the wall as a tube in torsion with a conservative shear stress of 5 MPa, including a margin for the corners. For the default 13 mm socket it gives about 8.5 N·m at the nut pocket and 9.4 N·m at the drive. If it falls below 2 N·m the editor warns you. To get more, increase “Wall”. Do not trust the number beyond its purpose: real prints vary with material, temperature and layer bonding, and the number does not describe what happens if you try to loosen a nut that is stuck.
Printing tips
Slice results for a Prusa MINI with the “0.20mm SPEED” profile and Prusament PLA at the default infill, with automatic supports switched on (no support material was generated in any of them):
| Example | Size | Filament | Time |
|---|---|---|---|
| Mini socket for M3 nuts, 5.5 mm | Ø 15.3 × 20.8 mm | 2.5 g | 23 min |
| Socket for M8 nuts, 13 mm, 3/8" | Ø 22.4 × 29.9 mm | 5.4 g | 34 min |
| Socket for M12 nuts, 19 mm, 1/2" | Ø 30.3 × 38.7 mm | 10.1 g | 45 min |
| Socket 24 mm for garden furniture, 1/2" | Ø 38.1 × 41.2 mm | 16.6 g | 53 min |
| Deep socket with through hole, 13 mm | Ø 23.4 × 50.1 mm | 8.5 g | 55 min |
| Knurled hand socket, 27 mm | Ø 44.8 × 22 mm | 12.0 g | 38 min |
Print with at least 4 perimeters and 40 % infill or more; this costs a few grams and makes the wall noticeably stronger. Use PLA for stiffness or PETG for toughness. No supports and no brim are needed. After printing, check the fit with the nut and the ratchet before you use the socket for the first time, and remove any ridge at the edge of the pocket or at the drive opening with a knife. A square recess printed slightly small is easy to correct with a file; a hex nut that is too loose cannot be repaired, so start with the default clearance and adjust from there.
Each socket is one part in one color. There is no color change and no multi-part export.
Related generators
The open-end wrench generator makes a flat spanner for furniture feet, which is the better tool when you only need to turn a nut at the end of a bolt. The socket set insert makes a tray for the real sockets you already own, and the bolt and nut generator prints the threaded fasteners themselves. This generator makes the socket for the nut: tuned for printing upright and for light duty.
Credits and licenses
The design is original. The idea of a parametric socket generator for any nut size comes from Shmoee’s OpenSCAD model on Printables (listed as CC BY 4.0); no code or mesh was copied. Fonts are bundled and listed on the licenses page.
Open the generator, look at the examples, and keep the caution in mind: light duty only, hand-tight, never with an impact wrench.
All parameters
The numeric settings of the generator with their default values and allowed ranges. Text, fonts, patterns and colors are set directly in the generator.
| Parameter | Default | Range | Meaning |
|---|---|---|---|
| Nut size (across flats) | 13 | – | Width of the nut across two parallel flats in mm (13 for M8, 17 for M10); the side length for square nuts. |
| Clearance | 0.3 | – | Extra room across the flats. 0.3 mm suits most printers: sand or file the pocket if the nut sticks. |
| Pocket depth | 10 | – | How deep the nut (and a bolt behind it) goes into the socket. At least the nut height, more for studs and long threads. |
| Wall | 3.5 | – | Material around the pocket corners. More is stronger and makes the socket thicker. |
| Core | 2.5 | – | Solid floor between the nut pocket and the drive opening. |
| Extension | 0 | – | Extra length between pocket and drive, for example for recessed nuts. |
| Entrance chamfer | 0.8 | – | Bevel at the pocket entrance that centers the nut when you slide it on. 0 = none. |
| Through hole | 0 | – | Hole through the whole socket for bolt ends sticking out. 0 = none (closed floor). |
| Drive clearance | 0.25 | – | Extra room of the square or hex drive opening. Too tight and the socket will not slip onto the drive. |
| Text size | 0 | – | Height of the capital letters, 0 = fit automatically. |
| Engraving depth | 0.6 | – | How deep the label is engraved. |
Frequently asked questions
Can I use a printed socket on car, bike or safety bolts or with an impact wrench?
No. A printed socket is for light duty only: hand-tight nuts on furniture, enclosures, models, toys, lamps and hobby projects. Plastic creeps, cracks at the corners of the drive and can break suddenly, and an impact wrench will destroy it in seconds. Never use it for wheel, brake, bicycle, ladder or any other safety-relevant fastener, and never to break loose a seized nut. The generator shows an estimated limit next to the controls; for the default 13 mm socket it is about 8.5 N·m, which is a rough upper guide for the wall alone and far below what a car bolt needs.
How do I choose the nut size and the clearance?
Measure the nut across two parallel flats with calipers and enter the value in “Nut size (across flats)”, or tap one of the presets: 13 metric sizes from 5.5 to 36 mm and 12 inch sizes from 1/4 to 1 1/4 inch. The clearance of 0.3 mm is added on top, so the pocket is slightly larger than the number you enter. If the nut sticks raise the clearance in steps of 0.05 mm, if it wobbles lower it. For the first print of a new size, set a small pocket depth and print a short test piece.
Which drive should I pick?
The 1/4, 3/8 and 1/2 inch settings make a square recess that fits the standard square drive of ratchets and extensions (6.35, 9.53 and 12.7 mm plus a clearance of 0.25 mm). Pick the one your ratchet has. “1/4 inch hex” makes a hex slot for a hex bit or hex adapter that you chuck into a cordless drill, and “By hand” leaves the drive end closed so you can turn the socket with your fingers, a knurled grip or an open-end wrench on the hex outside.
Does the socket need supports and how should I print it?
No supports. Print it standing on its drive end with the nut pocket facing up, exactly as exported. The pocket opens upward, the drive recess has a stepped pyramid roof that closes to a point at 42 degrees, and the engraved label gets sloped groove roofs. We sliced the 13 mm example in PrusaSlicer for a Prusa MINI with automatic supports switched on and the G-code contained no support material at all, and the same was true for all 14 examples.
How deep should the pocket be, and what is the extension for?
“Pocket depth” is how far the nut and the bolt behind it go into the socket. Use at least the height of the nut, for example 6.5 mm for an M8 nut, and more if the bolt or stud sticks out: the thread then needs room in the pocket or in a through hole. “Extension” adds length between pocket and drive, which you need for recessed nuts, and “Through hole” lets a long bolt or a threaded rod pass right through the socket.
Which material and settings are best?
PLA is stiff and fine for light duty; PETG or ASA is tougher and bends before it breaks. Print with at least 4 perimeters and 40 % infill or more at 0.2 mm layers. Because the socket stands upright, the layers are rings around the axis, which is the strong direction for turning. The first layers are the drive recess, so give the elephant foot a chance: the generator adds a small chamfer at the drive opening, but check the fit on the ratchet before you rely on it.
Origin & license
- Any size custom socket generator in OpenSCAD by Shmoee · CC BY 4.0 · idea – idea of a parametric socket for any nut size (no code or mesh taken; own design)