NPF rule calculator
At f/2.8 with a 24 mm lens and 5.9 µm pixels, stars on the celestial equator stay sharp for under three seconds: enter aperture, focal length, pixel pitch and declination to get your own limit. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Aperture as f-number N
- 2.8
- Focal length mm
- 24
- Pixel pitch um
- 5.9
- Declination deg
- 0
- Accuracy
- 0.5 s
- Accuracy label
- sharper
- Cos declination
- 1
- Numerator
- 130.4963
An NPF rule calculator answers a night-sky question the old 500 rule cannot: given your aperture, lens focal length, sensor pixel pitch, and the declination of the field, what is the longest fixed-tripod exposure that still keeps stars sharp? This capability returns the sharper (precise) NPF maximum shutter time in seconds using the full modern formula with accuracy factor one-half, so you leave less trailing on high-resolution sensors than the default NPF or the classic 500 and 600 rules allow. Enter f-number N, native focal length in millimetres, pixel pitch in micrometres, and minimum declination in degrees; the tool echoes the inputs, the cosine of declination, the NPF numerator, both sharper and default shutter times, a readable formula string, and step-by-step substitution you can assert in tests or field notes.
What the NPF rule is and why sharper matters
NPF stands for the three optical and sensor quantities that control how quickly a star trails across pixels during an untracked exposure: N for aperture as an f-number, P for photosite pitch in micrometres, and F for focal length in millimetres. Earth’s rotation makes stars move about fifteen arcseconds of right ascension per second of time; the longer the focal length and the smaller the pixels, the sooner that motion spans more than one pixel and shows as a trail.
The classic 500 rule divides five hundred by focal length and ignores aperture diffraction, pixel size, and sky position, so on modern dense sensors it is almost always too generous. The full NPF formula multiplies an accuracy factor k by a linear combination 16.856 times N plus 0.0997 times f plus 13.713 times p, then divides by f times the cosine of the minimum declination of the frame.
Cosine of declination stretches the allowed time near the poles and shortens it on the celestial equator, which matches how diurnal motion projects onto the sensor. This capability always uses the sharper variant with k equal to one-half—half the default NPF exposure—so the result targets tighter star points for landscape astrophotography and stacked nightscapes. Prefer native millimetre focal length, not crop-factor equivalent length, because the formula already sees true angular scale through pixel pitch.
Aperture enters as f-number, not millimetre hole diameter: wider apertures (smaller N) slightly reduce the recommended time because the point-spread function and the trail model interact in the original calibration.
Practical tips, pixel pitch, and related searches
Compute pixel pitch once per camera body: physical sensor width in millimetres divided by the number of pixels across the long edge, times one thousand, yields pitch in micrometres. Example full-frame bodies often land near five to six micrometres; smaller sensors or higher megapixel counts reduce pitch and therefore shorten the NPF shutter. Use the minimum declination of stars you care about in the frame—not the centre only—if the composition spans a wide strip of sky, because the equatorward edge trails fastest.
Keep optical values inside the published absolute range so the numerator and denominator cannot overflow into a non-finite result. Prefer sending numbers rather than pre-formatted strings when you control the client; string numbers are accepted only when they match a strict finite numeric pattern. This landing targets people searching for an NPF rule calculator, astrophotography shutter speed, or maximum exposure for stars with aperture and pixel pitch; it is not the 500 or 600 rule alone, not a tracker polar-alignment tool, and not a depth-of-field calculator.
Prefer this capability when you already know N, f, p, and δ and only need the sharper max shutter; if you only know crop factor and megapixels without pitch, convert to pitch first.
What you can do with it
Field planning for Milky Way landscapes
Before a dark-sky shoot, plug your lens f-number, native focal length, body pixel pitch, and the declination of the galactic core region to get a sharper per-frame shutter budget for fixed-tripod stacks.
Compare bodies and lenses offline
Product and kit planners sweep aperture and pitch combinations to see how a higher-megapixel sensor shortens the NPF limit versus an older camera on the same wide lens.
FAQ
What is the NPF rule in astrophotography?
NPF is a modern rule for the maximum fixed-tripod shutter time that keeps stars acceptably sharp. It uses aperture N, pixel pitch p, focal length f, and declination δ in the formula t = k·(16.856·N + 0.0997·f + 13.713·p) / (f·cos δ).
How do I find my camera’s pixel pitch?
Pixel pitch in micrometres equals (physical sensor width in mm ÷ number of pixels across the width) × 1000. Manufacturer specs or EXIF databases usually list sensor size and resolution.
Why is declination required?
Stars near the celestial poles move more slowly across the frame than stars on the equator. Cos(δ) stretches allowed shutter time as |δ| increases; |δ| must stay below 90° so the formula stays finite.
Is the NPF rule calculator free?
The browser tool is free and runs locally.
Why is the NPF time so much shorter than the 500 rule?
The 500 rule divides only by focal length and ignores aperture, pixel size and sky position, so on modern dense sensors it is almost always too generous. NPF accounts for all of them and gives shorter, sharper exposures.
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/hobby/npf-rule \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"aperture":2.8,"focal_length_mm":24,"pixel_pitch_um":5.9,"declination_deg":0}'const res = await fetch("https://api.kit.forhosting.com/hobby/npf-rule", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"aperture": 2.8,
"focal_length_mm": 24,
"pixel_pitch_um": 5.9,
"declination_deg": 0
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/hobby/npf-rule",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"aperture": 2.8,
"focal_length_mm": 24,
"pixel_pitch_um": 5.9,
"declination_deg": 0
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/hobby/npf-rule", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"aperture":2.8,"focal_length_mm":24,"pixel_pitch_um":5.9,"declination_deg":0}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"aperture":2.8,"focal_length_mm":24,"pixel_pitch_um":5.9,"declination_deg":0}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/hobby/npf-rule", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"aperture": 2.8,
"focal_length_mm": 24,
"pixel_pitch_um": 5.9,
"declination_deg": 0
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "hobby.npf_rule",
"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.
Limits
max_abs | 1000000000000 |
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
Non-positive aperture, focal length, or pixel pitch is rejected with invalid_input, and absolute declination at or beyond ninety degrees is rejected because cos(δ) vanishes.
How to call the API and what comes back
Declination may be zero or negative but must satisfy absolute value strictly less than ninety degrees so cos(δ) stays nonzero and the shutter time remains finite. Send a JSON body with four required finite numbers: aperture (aliases f_number, fstop, f_stop, N, f_n), focal_length_mm (aliases focal_length, f, focal_mm, focal), pixel_pitch_um (aliases pixel_pitch, pitch, p, pixel_size_um, pixel_size), and declination_deg (aliases declination, dec, delta, δ, dec_deg). Aperture, focal length, and pixel pitch must be strictly positive; zero or negative values return invalid_input and are never charged. Absolute values of optical inputs must stay within the published limit of one trillion so intermediate products remain finite in IEEE double precision on the Worker and in the browser. On success the response echoes rounded aperture, focal_length_mm, pixel_pitch_um, and declination_deg; sets accuracy to 0.5 and accuracy_label to sharper; reports cos_declination and numerator; sets shutter_s and max_shutter_s to the same sharper maximum time in seconds; includes shutter_default_s for the k equals one reference; sets unit to s, formula to the sharper NPF expression, message to a short English summary, and steps to an ordered array of substitution lines. Failed validation—missing fields, non-finite numbers, non-positive optical inputs, or polar declination—returns invalid_input. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, pixel pitch, and related searches
When you plan to stack many short frames, the sharper NPF time is a safe per-frame budget; if you accept mild trailing for fewer, brighter frames, compare shutter_default_s and decide consciously. Failed tasks that return invalid_input do not consume prepaid balance, which keeps field scripts cheap when you deliberately probe bad inputs. Round-trip checks are easy: recompute 16.856 times N plus 0.0997 times f plus 13.713 times p by hand, divide by f times cos of δ in radians, multiply by one-half, and confirm it equals shutter_s within the same twelve-decimal rounding.
Integration use cases
Unit tests for night-photo apps
Generate known-good sharper NPF times and deliberate non-positive input rejections for mobile calculator expected values and regression fixtures.
Technical questions
What does “sharper” NPF mean here?
This tool always applies accuracy factor k = 0.5 (precise / sharper). That is half the default NPF exposure (k = 1), reducing trailing on high-resolution sensors. The response also reports shutter_default_s for comparison.