# Stair & Ramp Calculator (IRC, IBC, ADA) (`jumblemog/stair-ramp-calculator`) Actor

Stair and ramp layout from plain text: riser count and height, tread depth, run, landings, stringers and stairwell opening by the IRC or IBC, ADA ramp runs and landings, and code checks of existing stairs.

- **URL**: https://apify.com/jumblemog/stair-ramp-calculator.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** AI, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Stair & Ramp Calculator (IRC, IBC, ADA)

**Lay out a stair or a wheelchair ramp to code, or check an existing stair, from one line of text.** Ask `basement stairs, 9 ft 4 in floor to floor, 36 in wide, 12 ft available` or `wheelchair ramp for a 30 in porch, 1:14 slope` and you get back:

- **The stair layout**: how many risers and how tall, how many treads and how deep, the total run, the angle, landings when one flight would climb too high, and whether it fits the space you have. The riser and tread are picked to meet the code and be comfortable to climb (2 risers + 1 tread close to 25").
- **Stringers**: how many, the length along the slope and the board length to buy, the cut for the bottom riser, and how much wood is left below the cuts.
- **The stairwell opening**: how long the hole in the floor above must be to keep 6'-8" of headroom.
- **The ramp layout**: the ramp length at 1:12 or your slope, split into runs of at most 30" rise with 60" landings, the total length with the top and bottom landings, and handrails.
- **Code checks** with pass or fail and the code section for each: riser, tread, width, headroom, flight rise, nosing, uniformity, handrail and guard heights, ramp slope, run rise, width and landings.
- **A drawing** (a to-scale side view with the upper floor and headroom) and a **Markdown report**. Every dimension comes in feet and inches to the nearest 1/16" (and in millimeters for metric input).

It's made for:

- Homeowners, deck builders, carpenters and remodelers laying out stairs before cutting stringers.
- Architects, inspectors, contractors and students checking a stair or ramp against the IRC, IBC or ADA.
- AI agents, home improvement apps and estimating tools that need code-based stair or ramp dimensions they can cite.

![A drawing made by this Actor for a basement stair with a 9'-4" rise: 15 risers of 7-7/16" and 14 treads of 10", an 11'-8" run, the upper floor with a 10'-1-3/16" stairwell opening and 6'-8" headroom, and the code checks passing](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/stair-ramp-calculator-example.png?signature=1lShmiPgEbvct9eltvjcZ)

### How to use it

1. Write **Stairs and ramps**, one per entry. The form has examples.
2. Optionally choose the **Default code**: the IRC for houses and decks, or the IBC for all other buildings. Words like `deck`, `house` or `commercial` in a request choose it too.
3. Click **Start**. Each request is a row in the results, with its summary, drawing and report.

#### What you can write

| You write | It means |
|---|---|
| `9 ft 4 in floor to floor`, `112 in rise`, `30 in high deck`, `2.8 m` | The total rise (stair or ramp) |
| `12 ft available`, `max run 3.5 m`, `8 ft of room` | The space for the stair's run or the ramp's length |
| `36 in wide`, `width 1 m` | Width (default: the code minimum) |
| `15 risers`, `7 in risers`, `11 in treads` | A riser count, or a riser height or tread depth you want |
| `2x6 treads`, `5/4 treads`, `with 2x10 stringers` | Tread thickness (for the bottom riser cut) and the stringer board |
| `headroom 7 ft`, `floor 12 in thick` | For the stairwell opening (defaults 6'-8" and 10-1/2") |
| `deck`, `porch`, `outdoor` | No floor above, so no stairwell opening; deck stringer span note |
| `commercial`, `office`, `school`, `IBC` | Lay out or check by the IBC |
| `ramp`, `wheelchair`, `ADA` with `1:16`, `1 in 20`, `6%` | A ramp, at that slope (default 1:12) |
| `check`, `existing`, `is it to code` with `8 in risers, 9 in treads, handrail 32 in, nosing 1 in, guard 34 in, risers vary by 1/2 in` | Check an existing stair |

Lengths without a unit are inches. The same as an object: `{"rise": "2.8 m", "run": "3.6 m", "width": "900 mm", "code": "irc"}` or `{"type": "ramp", "rise": 18, "slope": "1:15"}`.

### Examples

- `basement stairs, 9 ft 4 in floor to floor, 36 in wide, 12 ft available` → 15 risers of 7-7/16" and 14 treads of 10": an 11'-8" run (fits), 36.7°, three 2x12 stringers 15'-7-3/16" long (buy 16 ft), and a 10'-1-3/16" stairwell opening.
- `deck stairs 30 in high with 2x6 treads` → 4 risers of 7-1/2" and 3 treads of 10" (a 30" run), stringers with a 6" bottom riser cut; guards aren't needed at 30".
- `commercial stair, 12'-6" floor to floor, 44 in wide` → 22 risers of 6-13/16" and treads of 11-1/4" in two flights of 11 with a 44" landing, since an IBC flight may climb at most 12 ft.
- `wheelchair ramp for a 24 in porch, 20 ft available` → 24'-0" of ramp at 1:12 (34'-0" with landings): it doesn't fit, and the switchback length is given.
- `check existing stair: 8 in risers, 9 in treads, handrail 32 in, 13 risers` → fails riser height, tread depth and handrail height by the IRC.

### How-to examples

These are examples from **Examples** above, written as complete inputs; the result lines are from their runs.

#### How to calculate stair risers, treads and stringers

```json
{"requests": ["basement stairs, 9 ft 4 in floor to floor, 36 in wide, 12 ft available"]}
```

Result: 15 risers of 7-7/16" and 14 treads of 10": an 11'-8" run (fits), 36.7°, three 2x12 stringers 15'-7-3/16" long (buy 16 ft), and a 10'-1-3/16" stairwell opening.

#### How to design a wheelchair ramp

```json
{"requests": ["wheelchair ramp for a 24 in porch, 20 ft available"]}
```

Result: 24'-0" of ramp at 1:12 (34'-0" with landings): it doesn't fit, and the switchback length is given.

#### How to check an existing stair against the IRC

```json
{"requests": ["check existing stair: 8 in risers, 9 in treads, handrail 32 in, 13 risers"]}
```

Result: Fails riser height, tread depth and handrail height by the IRC.

#### How to let an AI agent lay out a stair or ramp

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/stair-ramp-calculator`. The agent writes the rise and the space ("9 ft 4 in floor to floor, 12 ft available") and passes on the riser and tread sizes, stringer length and whether it fits instead of guessing them.

### FAQ

**What can it lay out?** Straight stairs by the IRC or IBC, ramps by the IBC and ADA rules, and code checks of an existing stair.

**Which code does it use?** The IRC unless the request says commercial or you set `code` to `ibc`.

**Does it do winders or spiral stairs?** No. For an L or U stair, lay out each flight from its own rise.

**Is the result final?** It's a design aid. Local amendments and your building official have the final word.

**How many can I run at once?** Up to 200 stairs, ramps or checks per run, each as a line of text or an object. A request that can't be computed isn't billed.

**Does it work with Zapier, Make or n8n?** Yes. Call the Actor with its Apify app or an HTTP request and pass the results on.

### Input

| Field | What it is |
|---|---|
| `requests` | Stairs, ramps or checks, as lines of text or objects (up to 200 per run) |
| `code` | irc or ibc, when a request doesn't say |
| `charts` | Draw each stair or ramp (default on) |

### Output

One dataset item per request, also saved together in the run's `OUTPUT` record:

```json
{
  "request": 1, "status": "ok", "type": "stair", "title": "Stair for a 9'-4\" rise",
  "summary": "15 risers of 7-7/16\" and 14 treads of 10\" for a 9'-4\" rise: total run 11'-8\", 36.7° steep (IRC). 3 2x12 stringers 15'-7-3/16\" long (buy 16 ft). Fits the 12'-0\" available. Stairwell opening 10'-1-3/16\" long.",
  "stair": {"code": "IRC 2021 R311.7", "totalRise": 112.0, "risers": 15, "riserHeight": 7.467, "treads": 14, "treadDepth": 10.0,
            "totalRun": 140.0, "width": 36.0, "angle": 36.7, "flights": [15], "meetsCode": true, "fitsAvailableRun": true,
            "stairwellOpening": 121.2},
  "dimensions": {"riser": "7-7/16\"", "tread": "10\"", "totalRun": "11'-8\"", "stringerLength": "15'-7-3/16\"", "...": "..."},
  "stringers": {"board": "2x12", "count": 3, "spacing": 18.0, "lengthAlongSlope": 187.2, "buyLength": "16 ft", "throat": 5.25},
  "checks": [{"check": "Riser height", "value": "7-7/16\"", "limit": "≤ 7-3/4\"", "result": "pass", "ref": "IRC R311.7.5.1"}, "..."],
  "units": {"length": "in", "angle": "°"},
  "imageUrl": "https://api.apify.com/v2/key-value-stores/.../records/001-Stair-for-a-9-4-rise.png"
}
```

A ramp has `ramp` (slope, runs, rise and length of each run, landings, total length with and without the end landings, handrails, fitsAvailableLength) instead of `stair` and `stringers`. A check has `stair.passes`. Every item has `warnings`, `notes` (every assumption), a Markdown `report` and links to the drawing and report. A request that can't be computed has `"status": "failed"` and the reason in `error`, and isn't billed.

### How it works

1. **Risers**: the fewest risers within the code's maximum (7-3/4" IRC, 7" IBC), and a few more, are tried. For each, the tread is the comfortable 25" − 2 × riser, at least the code minimum (10" IRC, 11" IBC) and floored to 1/8". The winner meets the code and fits the space, then is the most comfortable and compact. If no code stair fits, the code stair is kept and you're told how much room it needs.
2. **Flights**: a flight may climb at most 12'-7" (IRC) or 12'-0" (IBC); taller stairs are split into equal flights with landings as deep as the stair is wide.
3. **Stringers**: length = risers × √(riser² + tread²); the wood left below the cuts is board depth − riser × tread ÷ diagonal, checked against 5" (AWC DCA6); spacing 18" for 1" or thicker treads.
4. **Stairwell opening**: (headroom + floor thickness) ÷ riser × tread back from the top riser, so the nosing line stays 6'-8" below the floor edge.
5. **Ramps**: length = rise ÷ slope, split into runs of at most 30" rise with 60" landings (IBC 1012, ADA 405), handrails on both sides above 6" of rise.

### Pricing

You pay one low price per request, at the price shown on this page: a stair layout, a ramp layout or a stair check. The drawing and report are included. Requests that can't be computed are never charged. If you set a maximum cost per run, the Actor stops before a request that wouldn't fit.

### Speed

A request takes milliseconds. A run through the API answers in about 10 seconds, including the cloud container starting.

### Tips and limits

- **This is a design aid.** Your local code amendments and the building official have the final word; measure the finished floor heights, not the framing.
- **Straight stairs.** Winders, spiral and curved stairs aren't laid out; for an L or U stair, lay out each flight from its own rise.
- **Ramps** follow the IBC and ADA rules, which suit wheelchair users at home too; the IRC alone asks only for 1:12 and 3 ft landings.
- **Not included**: handrail grip sizes, guard openings (the 4" sphere rule), stair lighting and structural sizing of stringers beyond the DCA6 notes.
- **Limits**: 200 requests per run.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool. Pass `requests` as plain text and read `summary`, `stair` or `ramp`, `checks` and `warnings`. A direct API call that waits for the answer:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~stair-ramp-calculator/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"requests": ["deck stairs 42 in high, 6 ft of room, 48 in wide, 2x6 treads"]}'
```

`run-sync` instead returns the run's `OUTPUT`: the status, the counts and every result as JSON.

In Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("jumblemog/stair-ramp-calculator").call(run_input={
    "requests": [{"rise": "9 ft 1 in", "run": "12 ft", "width": 36}, {"type": "ramp", "rise": 20, "slope": "1:16"}],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["summary"])
```

### Credits

- Method: International Code Council, *International Residential Code* 2021 (R311.7, R311.8, R312) and *International Building Code* 2021 (1011, 1012, 1014, 1015); the U.S. Department of Justice *2010 ADA Standards for Accessible Design* (403, 405, 505); American Wood Council *DCA 6 Prescriptive Residential Wood Deck Construction Guide*. This Actor is not affiliated with the ICC, the DOJ or the AWC.
- Drawings: [Vega-Lite](https://vega.github.io/vega-lite/) and [vl-convert](https://github.com/vega/vl-convert) (BSD-3-Clause), with the [Inter](https://rsms.me/inter/) font (SIL Open Font License).

# Actor input Schema

## `requests` (type: `array`):

One stair, ramp or check per entry, as a line of text or an object. Lengths in inches by default, or with units: 9 ft 4 in, 9'-4", 112 in, 2.8 m, 2845 mm. Stair: the total rise floor to floor, plus any of: available run ('12 ft available'), width, riser count ('15 risers'), riser height or tread depth you want, headroom, upper floor thickness, tread thickness ('2x6 treads'), stringer board ('2x10'), 'deck' or 'outdoor' (no stairwell opening). Ramp: say 'ramp' or 'wheelchair' with the rise, and optionally the slope ('1:16' or '6%'), width, landing length and available length. Check: say 'check' or 'existing' with riser height (or rise and riser count), tread depth and any of width, headroom, nosing, handrail and guard heights, 'risers vary by 1/2 in'. Houses and decks use the IRC; 'commercial', 'office', 'IBC' and similar use the IBC. Object fields: type (stair, ramp, check), rise, run, risers, riser, tread, width, headroom, floorThickness, treadThickness, stringer, slope, landing, nosing, handrail, guard, variation, outdoor, code, title, text.

## `code` (type: `string`):

Which code a stair follows when the request doesn't say (houses and decks are read as IRC, commercial buildings as IBC).

## `charts` (type: `boolean`):

A to-scale side view with the upper floor and headroom, or the ramp's runs and landings, above the list of code checks.

## Actor input object example

```json
{
  "requests": [
    "basement stairs, 9 ft 4 in floor to floor, 36 in wide",
    "deck stairs 30 in high with 2x6 treads",
    "commercial stair, 12'-6\" floor to floor, 44 in wide",
    "wheelchair ramp for a 24 in porch, 20 ft available",
    "check existing stair: 8 in risers, 9 in treads, handrail 32 in, 13 risers",
    {
      "rise": "2.8 m",
      "run": "3.6 m",
      "width": "900 mm",
      "code": "irc"
    }
  ],
  "charts": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per request: the summary and chart.

## `output` (type: `string`):

The OUTPUT record: every result in one JSON object.

## `files` (type: `string`):

Drawings (PNG and SVG) and Markdown reports in the run's key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "requests": [
        "basement stairs, 9 ft 4 in floor to floor, 36 in wide",
        "deck stairs 30 in high with 2x6 treads",
        "commercial stair, 12'-6\" floor to floor, 44 in wide",
        "wheelchair ramp for a 24 in porch, 20 ft available",
        "check existing stair: 8 in risers, 9 in treads, handrail 32 in, 13 risers",
        {
            "rise": "2.8 m",
            "run": "3.6 m",
            "width": "900 mm",
            "code": "irc"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/stair-ramp-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "requests": [
        "basement stairs, 9 ft 4 in floor to floor, 36 in wide",
        "deck stairs 30 in high with 2x6 treads",
        "commercial stair, 12'-6\" floor to floor, 44 in wide",
        "wheelchair ramp for a 24 in porch, 20 ft available",
        "check existing stair: 8 in risers, 9 in treads, handrail 32 in, 13 risers",
        {
            "rise": "2.8 m",
            "run": "3.6 m",
            "width": "900 mm",
            "code": "irc",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/stair-ramp-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "requests": [
    "basement stairs, 9 ft 4 in floor to floor, 36 in wide",
    "deck stairs 30 in high with 2x6 treads",
    "commercial stair, 12'\''-6\\" floor to floor, 44 in wide",
    "wheelchair ramp for a 24 in porch, 20 ft available",
    "check existing stair: 8 in risers, 9 in treads, handrail 32 in, 13 risers",
    {
      "rise": "2.8 m",
      "run": "3.6 m",
      "width": "900 mm",
      "code": "irc"
    }
  ]
}' |
apify call jumblemog/stair-ramp-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jumblemog/stair-ramp-calculator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/JkKiqR0YpLdFPIOJh/builds/rdw32f8wW8c7HhQtI/openapi.json
