Collar tie count calculator
A 40 ft ridge with ties every 4 ft needs 11 collar ties: one at each end of the ridge plus one at every spacing mark in between. It counts the ties for your lumber list, not the rafters themselves. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Ridge length
- 40
- Tie spacing
- 4
- Pieces per station
- 1
- Full bays
- 10
- Remainder
- 0
- Tie positions
- 11
Ordering lumber for a gable roof is not only about common rafters: many codes and engineer notes also call for collar ties high on the rafter pairs or rafter ties lower at ceiling level to resist outward thrust. This collar tie count calculator answers the takeoff question with a deterministic on-center formula. You provide the ridge length—the building dimension along which ties are spaced—and the required or maximum spacing in the same linear units, commonly four feet OC or forty-eight inches when plans work entirely in inches. The engine places a station at each end of the ridge, fills intermediate positions on the spacing grid, and multiplies by pieces per station (default one member connecting the opposing rafter pair). Zero or negative spacing is rejected with a clear invalid input error so estimating tools stay honest before stock is reserved.
Measure ridge length and keep tie spacing in matching units
Measure the length of the ridge—or the building eave run that mirrors it—in whatever linear unit your plans use. Tie spacing is the required or maximum on-center distance between successive collar-tie or rafter-tie stations along that ridge. Four-foot OC is a common residential schedule when ties land on every second or third rafter pair at sixteen or twenty-four inch OC, but always follow the code table or structural note on your drawings.
The calculator accepts any strictly positive finite spacing in the same units as the ridge length. If you measured forty feet of ridge, send spacing in feet (for example four). If you measured four hundred eighty inches, send spacing in inches (for example forty-eight).
The engine does not convert units, so mixing feet for length with inches for spacing will invent a nonsense count.
What you can do with it
DIY gable roof hardware and lumber lists
Homeowners enter ridge length and four-foot OC tie spacing and know how many collar or rafter ties to load before a weekend re-roof or porch build.
Contractor takeoff and bid automation
Estimating tools batch ridge runs from plans, apply code max spacing, and emit collar-tie or rafter-tie piece counts for purchase orders without spreadsheets.
FAQ
How does the collar tie count calculator count ties?
Exact multiples use length/spacing + 1; partial bays still count the far end.
What units should I use?
Any consistent linear system. 4). If both are in inches, use 48 for typical four-foot OC. Mixing feet and inches without converting will produce a wrong count.
What if spacing is zero or negative?
Tie spacing and ridge length must both be strictly positive; zero or negative values are rejected and not charged.
Is the collar tie count calculator free?
The browser tool runs free on your device.
Does this distinguish collar ties from rafter ties?
No. Both use the same station count along the ridge at the required spacing. Elevation on the rafter, lumber size and nailing schedule remain design choices outside this takeoff tool.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/home/collar-tie-count \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"ridge_length":40,"tie_spacing":4}'const res = await fetch("https://api.kit.forhosting.com/home/collar-tie-count", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"ridge_length": 40,
"tie_spacing": 4
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/home/collar-tie-count",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"ridge_length": 40,
"tie_spacing": 4
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/home/collar-tie-count", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"ridge_length":40,"tie_spacing":4}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"ridge_length":40,"tie_spacing":4}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/home/collar-tie-count", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"ridge_length": 40,
"tie_spacing": 4
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "home.collar_tie_count",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The browser tool runs free on your device; the prepaid API charges $0.002 per successful item when apps and SDKs need the same contract.
Measure ridge length and keep tie spacing in matching units
Send that value as ridge_length; aliases ridge, length, building_length, eave_length and run_length are accepted for form labels that prefer those names. Both fields must be strictly positive finite numbers: zero, negative or non-numeric values raise invalid_input and are not charged. Extremely small or huge values outside the published stability range are also rejected so floating-point bay math stays meaningful on a Worker isolate. Optional aliases for spacing include spacing, oc, on_center, centers, max_spacing, collar_spacing and rafter_tie_spacing, covering common takeoff spreadsheet headers.
How end stations, OC bays, and pieces per station are counted
When the ridge length is an exact multiple of the spacing, the position count is simply length divided by spacing plus one. When a partial bay remains at the far end, the engine still counts the closing end station, which is equivalent to floor(length divided by spacing) plus two. Collar ties (near the ridge) and rafter ties (near the ceiling line) share this same station-count model; the engine does not distinguish elevation—only how many stations and pieces your schedule requires along the ridge. The layout always includes a tie station at each end of the ridge, then places intermediate stations every tie_spacing along the run. That yields full_bays, remainder (zero when the end lands on grid), and tie_positions. By default pieces_per_station equals one: each station needs a single collar or rafter tie connecting the opposing rafter pair, so ties_needed equals tie_positions. Set pieces_per_station to two when the schedule calls for doubled members at every station, or higher only when your framing standard stacks more pieces under the same OC grid. The method label is always oc_ends_inclusive_times_pieces for stable downstream branching. Missing required length or spacing, zero or negative dimensions, and pieces_per_station outside the allowed integer range fail with invalid_input. Identical inputs always produce identical JSON because the path is pure arithmetic with no network, random seed or wall clock.
API usage, pricing, roof takeoff workflows, and practical limits
Call the free in-browser collar tie count calculator for quick site estimates, lumber-yard kiosks and contractor whiteboards without installing a spreadsheet. Send a JSON body with ridge_length and tie_spacing, plus optional pieces_per_station when the default single member does not match your schedule. Use the prepaid API when a renovation app, quantity-takeoff pipeline, modular home configurator or property-management tool needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with home.rafter_count when you also need common-rafter quantity from ridge length and rafter OC, or with home.rafter_length when cut length of each common rafter from span and pitch is next on the list. Remember that hip and valley roofs, jack rafters, ridge boards and ceiling joists are separate takeoff lines—if your material list already includes those, keep them separate rather than inflating pieces_per_station. Authors shipping SDKs can map ties_needed straight into purchase orders while showing tie_positions, full_bays and remainder as explanatory detail for the estimator.
Integration use cases
Lumber yard and ecommerce cut-list tools
Retail sites compute collar-tie counts as shoppers change building length or max-spacing options, using the same deterministic API contract for quotes and carts.