LEARN · 2026-10-07
Compression spring design: spring rate formula, spring index, free length and solid height (with worked example)
How to design a compression spring: spring rate k = G·d⁴ / (8·D³·n), a spring index C = D/d of 4–12, the Wahl stress factor, free length and solid height for the four end types, shear modulus G of music wire (SWP) and SUS304 stainless, plus a complete example from load requirement to wire, coils and pitch.
The spring rate formula: k = G·d⁴ / (8·D³·n)
When a helical compression spring is squeezed, the wire itself is loaded in torsion. Treating each coil as a twisted bar gives the spring rate (stiffness) k — the force needed per millimetre of deflection:
k = F / δ = G·d⁴ / (8·D³·n) δ = 8·F·D³·n / (G·d⁴)
d is the wire diameter, D the mean coil diameter (through the wire centre), n the number of active coils and G the shear modulus of the material (N/mm²). Catalogues usually list the outer diameter OD or inner diameter ID: D = OD − d = ID + d. Only active coils deflect; the closed dead coils at the ends are not counted in n but are included in the total coils Nt.
| Change (all else equal) | Effect on k | Why |
|---|---|---|
| Wire diameter d +10% | +46% | k ∝ d⁴ (1.1⁴ ≈ 1.46) |
| Mean diameter D +10% | −25% | k ∝ 1/D³ (1/1.1³ ≈ 0.75) |
| Active coils n +10% | −9% | k ∝ 1/n (1/1.1 ≈ 0.91) |
| Music wire SWP → stainless SUS304 | −13% | G 78.5 → 68.5 GPa |
Wire diameter acts to the fourth power and coil diameter to the third, so change d or D to move the rate a lot and fine-tune with the coil count. A music-wire spring with d = 1.5 mm, D = 13.5 mm and n = 8 has k = 78500 × 1.5⁴ / (8 × 13.5³ × 8) ≈ 2.52 N/mm.
TIPWire tolerance matters more than people expect: ±0.02 mm on a 1 mm wire changes k by about ±8%. When the force must be accurate, specify a load at a given length with a tolerance and let the spring maker adjust the coils, rather than specifying k alone.
Spring index C = D/d and the Wahl correction
The spring index C describes how tightly the spring is wound. A small C bends the wire severely during coiling, concentrates stress on the inside and makes the spring hard to manufacture; a large C gives a soft spring that tangles, buckles easily and is hard to hold to tolerance on OD and free length. Design for 4–12, ideally 6–10. The spring generator warns when C is below 4 or above 16.
C = D / d Kw = (4C − 1) / (4C − 4) + 0.615 / C
Once wire is coiled, the shear stress on the inside of the coil is higher than in a straight bar in torsion. The Wahl factor Kw corrects for both curvature and direct shear — the smaller C, the larger the correction:
| Spring index C | Wahl factor Kw | Inner stress increase | Comment |
|---|---|---|---|
| 4 | 1.40 | +40% | Lower limit: hard to coil, high stress |
| 6 | 1.25 | +25% | Stiff and compact |
| 8 | 1.18 | +18% | Common range |
| 10 | 1.14 | +14% | Common range |
| 12 | 1.12 | +12% | Upper limit: soft, buckles more easily |
TIPWhen space is tight, fix the OD (or the ID and the guide rod) first, then choose the wire for C = 6–10. For OD 15 mm, d = 1.5 mm gives D = 13.5 mm and C = 9 — right in the ideal range.
End types, free length and solid height
Free length L0 is the unloaded length; solid height Ls is the length when every coil touches its neighbour and the spring cannot compress further. L0 − Ls is the maximum available deflection. The end type sets how many coils are inactive (end coils Ne) and how the lengths are calculated:
| End type | End coils Ne | Total coils Nt | Free length L0 | Solid height Ls | Example: d 1.5, n 8, p 3.06 (L0 / Ls, mm) |
|---|---|---|---|---|---|
| Plain (open) | 0 | n | p·n + d | d·(Nt + 1) | 25.98 / 13.5 |
| Plain and ground | 1 | n + 1 | p·(n + 1) | d·Nt | 27.54 / 13.5 |
| Closed (squared) | 2 | n + 2 | p·n + 3d | d·(Nt + 1) | 28.98 / 16.5 |
| Closed and ground | 2 | n + 2 | p·n + 2d | d·Nt | 27.48 / 15.0 |
The formulas follow Shigley's Mechanical Engineering Design; the closed-end rules match the spring generator, which adds one dead coil with pitch equal to the wire diameter at each end, while grinding removes about half a wire from each end. Closed ends let the spring stand square; ground ends also make the seat perpendicular to the axis with minimum wobble — the choice for precision mechanisms.
- Keep the shortest working length at least 10–15% of the stroke above Ls. Never run a spring solid: the coils clash and the stress jumps.
- Work between about 20% and 80% of the maximum deflection: too little and the end coils seat unevenly and the rate is non-linear; too much and you are close to solid.
- Grinding plain ends leaves a tiny seat, so the generator recommends closed ends instead.
Materials and shear modulus G: SWP, SUS304, phosphor bronze
G is the shear modulus (modulus of rigidity), related to Young's modulus by G = E / (2(1 + ν)). The table lists the design values used by JIS B 2704. Tensile strength varies strongly with wire size (thinner wire is stronger); the column gives indicative values around ⌀1 mm — always check the wire standard.
| Material | Standard | G (GPa) | E (GPa) | Tensile ≈ ⌀1 mm (indicative, MPa) | Max. temperature | Notes |
|---|---|---|---|---|---|---|
| Music wire SWP-A / SWP-B | JIS G 3522 | 78.5 | 206 | 2000–2400 | ≈ 120 °C | Strongest and most common; needs plating or oil against rust |
| Hard-drawn steel wire SW-C | JIS G 3521 | 78.5 | 206 | 1700–1900 | ≈ 120 °C | Low cost, general purpose |
| Stainless SUS304-WPB | JIS G 4314 | 68.5 | 186 | 1600–1900 | ≈ 250 °C | Corrosion resistant: food, outdoor, humid use |
| Precipitation-hardened SUS631J1 (17-7PH) | JIS G 4314 | 73.5 | 196 | Higher than SUS304 | ≈ 300 °C | High strength and heat resistance, more expensive |
| Phosphor bronze wire | JIS H 3270 | 41.7 | 98.1 | 700–900 | ≈ 100 °C | Non-magnetic and conductive: electrical contacts |
τ = Kw · 8·F·D / (π·d³)
For static loads (few cycles), keep the Wahl-corrected shear stress below about 45% of the tensile strength for music and hard-drawn wire, or 35% for stainless — Shigley's guideline for springs without set removal. Fatigue applications with hundreds of thousands of cycles need lower stresses; use the spring maker's fatigue diagrams.
Buckling check
Stable if L0 < 5.26·D (flat parallel ends, guided) L0 < 2.63·D (pivoted ends)
A slender spring bows sideways like a column when compressed. Beyond these ratios, add a guide rod inside or a sleeve outside, with enough clearance to avoid rubbing.
TIPStainless has about 13% lower G than music wire, so swapping materials at the same size drops k by about 13%; remove a coil (e.g. 8 → 7) to keep the rate. The generator uses G = 79.3 GPa (generic steel), about 1% above the JIS value of 78.5 GPa.
Worked example: from load requirement to wire, coils and free length
Requirement: the spring sits on a ⌀8 mm guide rod inside a ⌀16 mm bore. It must give 10 N preload at an installed length of 25 mm and 25 N at 19 mm (6 mm stroke). Material: music wire SWP-B, closed ends.
- Spring rate: k = (25 − 10) / (25 − 19) = 15 / 6 = 2.5 N/mm.
- Size: OD 15 mm (1 mm clearance to the ⌀16 bore) with 1.5 mm wire gives D = 13.5 mm, ID 12 mm (ample clearance to the ⌀8 rod) and C = 9.
- Active coils: n = G·d⁴ / (8·D³·k) = 78500 × 5.0625 / (8 × 2460.4 × 2.5) ≈ 8.08, so n = 8 and the actual k ≈ 2.52 N/mm.
- Free length: L0 = 25 + 10 / 2.52 ≈ 29.0 mm; loads at 25 mm and 19 mm are about 10.1 N and 25.2 N.
- Solid height: closed ends give Nt = 10 and Ls = (10 + 1) × 1.5 = 16.5 mm. The shortest working length of 19 mm is 2.5 mm above Ls (about 42% of the stroke), and the working points sit at 32–80% of the 12.5 mm maximum deflection.
- Pitch: p = (L0 − 3d) / n = (29 − 4.5) / 8 ≈ 3.06 mm; with ground ends p = (29 − 3) / 8 = 3.25 mm and Ls = 15 mm.
- Stress: Kw = 1.162, so at F = 25 N τ = 1.162 × 8 × 25 × 13.5 / (π × 1.5³) ≈ 296 MPa; at solid (F ≈ 31.5 N) τ ≈ 373 MPa — far below 0.45 × about 2000 MPa ≈ 900 MPa.
- Buckling: L0 / D = 29 / 13.5 ≈ 2.15 < 2.63, so it is stable even with unguided ends.
| Item | Music wire SWP-B | Stainless SUS304 |
|---|---|---|
| G (GPa) | 78.5 | 68.5 |
| Active coils n | 8 | 7 |
| Spring rate k (N/mm) | 2.52 | 2.52 |
| Total coils Nt (closed ends) | 10 | 9 |
| Free length L0 (mm) | 29.0 | 29.0 |
| Solid height Ls (mm) | 16.5 | 15.0 |
| Pitch p (mm) | 3.06 | 3.50 |
| Shear stress at 25 N (MPa) | 296 | 296 |
| Shear stress at solid (MPa) | 373 | 417 |
| Static allowable shear stress (MPa) | ≈ 900 (0.45 × 2000) | ≈ 610 (0.35 × 1750) |
Enter wire 1.5, OD 15, 8 active coils, pitch 3.06 and closed ends in the spring generator to download a STEP / STL for interference checks. Its spec card shows k ≈ 2.55 N/mm because it uses G = 79.3 GPa. The OD grows only about 0.03 mm when compressed, so 1 mm of bore clearance is plenty.
TIPWhen ordering from a spring maker, state the material, wire d, OD or ID (and the rod or bore it works on), free length L0, active or total coils, end type, and a load at a length with tolerance (e.g. 25 N ± 10% at 19 mm). Specifying the load is easier to make than fixing L0, n and k all at once.
FAQ
How do I calculate the spring constant of a compression spring?
k = G·d⁴ / (8·D³·n), with G the shear modulus (music wire about 78.5 GPa = 78500 N/mm², SUS304 about 68.5 GPa), d the wire diameter, D the mean diameter (OD − d) and n the active coils. A music-wire spring with d = 1.5 mm, D = 13.5 mm and n = 8 is about 2.52 N/mm.
What spring index should I use?
Keep C = D/d between 4 and 12, ideally 6–10. Below 4 the spring is hard to coil and highly stressed on the inside; above 12 it tangles, buckles and is harder to hold to tolerance. The generator warns outside 4–16.
What is the difference between free length and solid height?
Free length L0 is the unloaded length; solid height Ls is the length with all coils touching. The difference is the maximum deflection. For closed ends Ls = (Nt + 1)·d, for closed and ground ends Nt·d. Keep the shortest working length at least 10–15% of the stroke above Ls.
Can I 3D print a compression spring?
PLA springs creep and snap, so they suit display or very light loads only; PETG, nylon and TPU last longer. For real loads use a metal spring — the generated model is useful for design, assembly drawings and as a reference when ordering one.
Stainless steel or music wire?
Music wire is the strongest and inexpensive but needs rust protection. SUS304 resists corrosion and works up to about 250 °C, but its G is about 13% lower and its strength lower too, so the same geometry is softer and allows less stress. Choose SUS304 for humid, outdoor and food equipment, music wire for indoor mechanisms and high stresses.