OSPF Cost Calculator
Compute an OSPF interface cost from a reference bandwidth and interface bandwidth, clamped to the 16-bit metric range.
This tool handles input and primary processing in your browser and is designed not to send the input to QuickKit’s server.
Cost
| OSPF cost | — |
|---|---|
| Quotient (rounded to 6 decimals) | — |
| Floored quotient | — |
| Clamped to 1–65535 | — |
| Reference bandwidth (bit/s) | — |
| Interface bandwidth (bit/s) | — |
| Cisco IOS / IOS-XE reference-bandwidth example | — |
| Cisco IOS / IOS-XE manual cost example | — |
How it works
RFC 2328 does not define a cost formula; it is set by configuration. Most implementations derive a default as floor(reference bandwidth / interface bandwidth) with a minimum of 1. Cisco IOS / IOS-XE defaults the reference bandwidth to 100 Mbps and raises it with `auto-cost reference-bandwidth <Mbps>`; other platforms differ, so enter the reference bandwidth your platform actually uses. Enter both bandwidths with their units and this shows the quotient rounded to 6 decimal places, the floored value, and the final cost clamped to 1–65535 (the router-LSA metric field is 16 bits). Whenever the final cost is 1, that is flagged — every link at least this fast also floors to cost 1, so they cannot be told apart by cost; raising the reference bandwidth is how you make them comparable, and it must be set consistently on every router in the area. The generated `auto-cost` and `ip ospf cost` lines are Cisco IOS / IOS-XE examples, not portable OSPF syntax — other platforms use different commands. Verify against your platform and release.