Printing threaded screw caps: guide and tips
What is the screw cap generator?
A lost cap, a broken end cap, a jar without a matching lid: usually all that is missing is one small part with the right thread. That is what this generator makes. You pick the thread from a list or measure it yourself, set size, grip and top, and download the finished cap as STL or 3MF. Everything is computed in your browser, nothing is uploaded, and the whole design lives in the page’s link – copy it with “Share” to continue later.
The generator makes three things: a cap with an internal thread that screws onto a bottle, a jar or a pipe; a plug with an external thread that fits into an opening with an internal thread; and a coupler with two internal threads back to back. It always prints with the closed side down. The smooth top lies on the print bed, the thread grows upward and needs no supports.
The range goes from the PET bottle cap and the cap for a garden tap to the jug cap and the replacement toothpaste tube cap. If you like experiments, print the tornado connector for two bottles.
Which thread does my bottle have?
This is the most important question, because a cap only fits when diameter, pitch and tooth shape match. The generator knows the common families:
- PET bottles (PCO 1881 and PCO 1810): almost every water, juice and soda bottle has a 28 mm neck. Newer bottles use PCO 1881 with its short neck, older ones PCO 1810 with a slightly longer thread. The sizes come from the publicly available standard drawings; the cap’s skirt, thread and seat follow them.
- SPI neck finishes 400, 410 and 415: cosmetic, spray, pump and lab bottles as well as many plastic storage containers. The name gives the diameter in millimeters first, then the style: 28-400 is a short neck with one turn of thread, 410 and 415 have taller necks with more thread.
- Mason jars: canning jars with a 70 or 86 mm thread, popular for overnight oats and pantry storage. A printed lid replaces the two-piece metal closure for dry contents.
- Bottle necks of 38 and 48 mm: wide-mouth juice bottles and jugs of three to five liters. These sizes come from an unchecked source; the generator says so, and a short test cap is worth it.
- Pipe threads G (BSPP): parallel Whitworth pipe thread with a 55° flank angle to ISO 228-1, from G 1/8 to G 4. Garden taps and hose fittings almost always use G 3/4, so do washing machine connections; water filters often use G 1/2 or G 1.
- Metric threads M8 to M64: ISO coarse threads, for example for end caps on threaded rods or bolts.
How to find your thread: with a caliper, measure the outer diameter across the thread crests of the part the cap goes on – the bottle neck or the pipe. Then measure the pitch: put the caliper across five or ten turns and divide by their number. A garden tap with 26.4 mm across the thread and a pitch of 1.81 mm is G 3/4; a bottle neck with 27.4 mm and a pitch of 2.7 mm is PCO 1881. If nothing in the list fits, use a custom thread.
Custom or measured thread
“Custom thread” offers two ways. With nominal sizes you enter diameter, pitch, flank angle and the number of starts – handy for standard threads that are not in the list, or for multi-start threads.
The second way is measured, made for everything whose cap got lost: tubes, paint jars, medicine bottles or the hose cap of an air pump. Here you enter exactly what the caliper shows: the outer diameter, the pitch and the length of thread the cap should cover. Leave out the bead at the end of the thread. A few settings tune the fit:
- Play: the gap between the thread crests and the cap’s bore on each side. 0.4 mm suits most printers.
- Crest cut: cuts the tips of the teeth flat so the cap turns more easily.
- Tooth gap: makes the teeth slimmer when the cap fits the diameter but catches on the pitch.
- Walls, bevel and spaces: the wall may get thicker or thinner toward the opening, a 45° bevel helps the cap start, and an unthreaded space at the closed end leaves room for a washer.
Five presets with measurements of real parts help you start, for example the toothpaste tube, the 50 ml paint jar or the cap with a hole for a hose. Still check the values on your own part, because manufacturers change their packaging.
Cap, plug or coupler
The cap is the usual case: a closed plate with the internal thread on top of it. The top thickness decides how sturdy the plate is and how deep a label may go. The outer diameter can set itself – thread plus wall. For bottles there is a sealing lip: a narrow ring on the cap’s floor that presses into the mouth as you screw the cap on. Its diameter follows the inner diameter of the neck plus 0.3 mm, but you can set it yourself.
The plug turns the idea around: a disk with an external thread. Printed hollow it saves material and becomes a threaded neck that takes a regular cap – the threaded neck for PET caps turns any container into a bottle with a screw closure. As a closure it seals barrels, housings or water tanks, for example as the hollow G 1 plug.
The coupler joins two external threads. The first thread opens toward the print bed, the second one at the top, with a passage in between. The transition is a 45° cone, so the ceiling above the lower thread prints without supports as well. With two PET bottles it becomes the classic water vortex experiment: join the bottles, flip them, swirl.
The grip ribs come from the original project: small round ridges around the rim. The spacing sets how many there are, the size sets their diameter. A few strong ribs grip better with gloves or wet hands, fine ribs look more elegant.
Labels and colors
Because the top lies on the print bed, a label cannot stand out. It is either engraved – cut in the cap’s color – or inlaid flush. The flush inlay needs a color of its own: it sits in the first layers and fills the recess exactly, so the top stays smooth. The 3MF holds cap and label as separate parts that PrusaSlicer, Bambu Studio and OrcaSlicer assign to the right extruders straight away. One example is the two-color mason jar lid.
You can choose text in several fonts or your own, a logo from the collection or your own SVG, or one of 100 patterns such as the honeycomb on the jug cap. At least 0.6 mm of the top always stays below the label.
Printing tips
- Layer height: 0.2 mm at most; for fine threads below 1.5 mm pitch, 0.1 to 0.15 mm is better.
- Tune the play: if the cap binds, raise the thread play in steps of 0.1 mm; if it wobbles, lower it. Every printer prints internal threads a little tighter than planned.
- Test cap: set the turns to one and the top to 1 mm – this flat cap prints in a few minutes and shows whether the fit is right. PET caps take their length from the standard and print quickly anyway.
- Material: PETG is tough, handles heat and chemicals better than PLA and is the best choice for bottle caps. PLA is fine for storage jars and pipe caps out of the sun.
- Elephant’s foot: the first layer is the top. An elephant’s foot there only widens the rim a little and does not affect the thread.
- Sealing: for water and garden fittings, put in a standard flat washer; the sealing lip helps on bottles. Printed caps are not suitable for pressure or carbonation.
By the way, a name tag for the neck of the same PET bottles is what the bottle clip makes.
Origin and credits
The generator is based on cap-generator by Christian Muehlhaeuser (MIT license). Its customizer cap.scad builds a round cap with an internal or external thread and round grip ribs; we ported this logic to TypeScript and check it against the original in OpenSCAD: height, outer size and ribs match exactly, the volume within a few percent. The thread itself comes from our own module modeled on threads-scad by Ryan A. Colyer (CC0) and the pipe thread sizes of ISO 228-1.
The “Measured” mode is a port of Customizable Screw Cap by DrLex, published under Creative Commons Attribution 4.0. Play, crest cut, tooth gap, the tapered wall, bevel, unthreaded spaces, the triangular ribs, the hole in the top and the measurements of the presets come from there. DrLex asks everyone who sells caps made with it for a visible attribution with a link to his project – on the sales page and with the part itself.
The SPI neck and mason jar sizes come from bottlecaps.scad of the BOSL2 library by Revar Desmera (BSD-2-Clause). All license texts are on the licenses page. Now open the generator or browse the examples.
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 |
|---|---|---|---|
| Cap | |||
| Top thickness | 3 mm | 0.6 – 20 mm | The closed plate under the thread; it lies on the bed when printing. |
| Outer diameter | 93 mm | 0 – 160 mm | 0 = automatic: thread plus wall. |
| Wall | 2.4 mm | 1.2 – 6 mm | Wall around the thread when the outer diameter is automatic. |
| Passage | 10 mm | 3 – 60 mm | Hole between the two threads of the coupler. |
| Thread | |||
| Turns of thread | 4 | 0.5 – 20 | Thread length in turns. Bottle and jar presets bring their own value. |
| Thread play | 0.3 mm | 0 – 1 mm | Play in the diameter. If the cap binds, raise it in steps of 0.1 mm; if it wobbles, lower it. |
| Thread lead-in | 20 ° | 0 – 180 ° | Chamfer at the open end of the thread, given as an arc of the helix. Helps the cap catch. |
| Custom thread | |||
| Nominal diameter | 30 mm | 5 – 150 mm | Outer diameter of the external thread (bottle neck, pipe, bolt). |
| Pitch | 2 mm | 0.5 – 8 mm | Distance from one turn to the next. |
| Flank angle | 60 ° | 29 – 90 ° | Angle between the tooth flanks: 60° metric, 55° pipe threads, 30° trapezoidal. |
| Starts | 1 | 1 – 4 | Multi-start threads (many drink bottles) close with less turning. |
| Measured thread | |||
| Thread outer diameter | 12 mm | 5 – 80 mm | Measured across the thread crests of the part the cap goes on. |
| Pitch | 1.25 mm | 0.2 – 5 mm | Measure across several turns and divide by their number. |
| Thread length | 7 mm | 2 – 30 mm | How far the cap should cover the thread, without a bead at its end. |
| Play | 0.4 mm | 0 – 2 mm | Gap between the thread crests and the cap’s bore on each side. 0.4 mm works in most cases. |
| Crest cut | 20 % | 0 – 80 % | Cuts the tooth tips flat so the cap turns more easily. |
| Tooth gap | 0 | 0 – 0.5 | Extra space between the teeth as a share of the pitch; gives slimmer teeth. |
| Wall at the top | 1.2 mm | 1 – 6 mm | Wall thickness at the closed end. |
| Wall at the opening | 1.2 mm | 1 – 6 mm | Wall thickness at the open end; the wall tapers in between. |
| Plain rim | 0.5 mm | 0 – 5 mm | Unthreaded part at the opening. |
| Lead-in bevel | 0.5 mm | 0 – 2 mm | 45° bevel at the opening, at most as long as the plain rim. |
| Space inside | 0 mm | 0 – 30 mm | Unthreaded part at the closed end, for example for a washer. |
| Hole in the top | 0 mm | 0 – 75 mm | For a nozzle or a hose; 0 = closed. |
| Grip | |||
| Rib spacing | 1 | 1 – 8 | Larger values give fewer ribs. |
| Rib size | 2.3 | 1 – 3 | Diameter of the ribs. |
| Number of ribs | 32 | 16 – 128 | Triangular ribs around the cap. |
| Plug | |||
| Inner wall | 5 mm | 0 – 30 mm | Wall of the hollow plug under the thread. |
| Sealing lip | |||
| Lip diameter | 0 mm | 0 – 140 mm | 0 = inner diameter of the neck + 0.3 mm. |
| Lip height | 2 mm | 0.5 – 6 mm | How far the lip reaches into the mouth. |
| Label | |||
| Text size | 0 mm | 0 – 40 mm | Height of the capital letters, 0 = automatic. |
| Depth | 0.6 mm | 0.2 – 1.5 mm | Depth of the engraving or inlay; at least 0.6 mm of the top stays below it. |
Frequently asked questions
Which thread does my bottle have?
Most PET water and juice bottles use a 28 mm PCO 1881 neck, older ones PCO 1810. Measure the outer diameter across the thread and compare it with the list; when in doubt, print a short test cap first.
Does the cap seal?
With the sealing lip or a flat washer inside, yes, for water and dry goods. Without a seal it only closes loosely.
Can I use it for carbonated drinks?
No. Carbonation builds up several bar of pressure; a printed cap can crack or pop off. Use it only for unpressurized contents.
Is the cap food safe?
Printed parts have grooves where germs can stay. Use it with food only briefly and with a suitable filament such as PETG.
The cap binds or is too loose – what now?
Raise or lower the thread play in 0.1 mm steps and print with layers of 0.2 mm or less.
How do I measure an unknown thread?
With a caliper: the outer diameter across the thread crests, the length over five or ten turns divided by their number as the pitch, and the threaded length without the bead at its end. Enter these three values under “Custom thread” with “Measured”.
Origin & license
- cap-generator by Christian Muehlhaeuser · MIT · code ported – Cap, plug and grip ribs of cap.scad ported to TypeScript; thread data of the 38 and 48 mm bottle necks
- Customizable Screw Cap by DrLex · CC BY 4.0 · code ported – Measured thread: play, crest cut, tooth gap, conical wall, bevel, ribs, hole; preset measurements
- BOSL2 by Revar Desmera · BSD-2-Clause · helper code ported – SPI bottle neck and mason jar thread data from bottlecaps.scad (core/mech/thread-table.ts)
- threads-scad by Ryan A. Colyer · CC0 1.0 · helper code ported – Thread surfaces from point rings (core/geometry/threads.ts, after ScrewThread)