5 min read

How to Calculate Landed Cost for US Imports: Formula, Worked Logic, and Code

A shipping box on a balance scale opposite a stack of translucent blocks
Landed cost adds up every layer between the factory price and goods on your shelf.

Who is affected and why it matters

Landed cost is the full cost of getting a product to its destination: the purchase price plus everything that happens on the way. If you are a developer building checkout, quoting, or ERP features, it decides whether your prices make money. If you are an importer, it decides whether a product line is worth carrying.

Tariffs make this harder than it looks. A single HTS line can carry a base duty plus one or more additional measures, and the result depends on origin and date. A landed-cost number built on a spreadsheet duty rate from last quarter is a guess.

The landed cost formula

At the top level:

Landed cost = product cost + logistics + customs value-based charges + other fees

Broken out for a US import:

landed_cost = product_cost
            + international_freight + insurance
            + duty            (customs_value × resolved duty rate, plus any per-unit duty)
            + cbp_fees        (MPF, and HMF for ocean cargo)
            + brokerage + domestic_delivery + handling

The detail that trips most people up: duty is not charged on landed cost. It is charged on customs value, which is a narrower number.

Step 1: Get customs value right

US duty is generally assessed on transaction value, the price actually paid or payable for the goods when sold for export to the United States, as defined in 19 U.S.C. 1401a. Some things are added to it, such as certain packing costs, selling commissions, assists, and royalties. Some are left out, notably international freight and insurance when they are identified separately.

That is a real difference from countries that assess duty on CIF value. If you copy a formula built for another market, you will overstate US duty.

CBP’s informed compliance publications on customs value and on proper deductions for freight cover the rules in depth.

Step 2: Resolve the duty rate

Duty depends on three inputs:

  • the 10-digit HTS code (look it up in our HTS browser or the official USITC schedule)
  • the country of origin, which is not always the country you ship from
  • the date of entry, since rates and additional measures change

The resolved rate is the base rate plus any Chapter 99 additional measures that apply, such as Section 301 or Section 232. Our guide to how tariff stacking works covers how those layers combine.

Here is a request for sports footwear with rubber or plastic soles and textile uppers, valued over $12 a pair, made in Vietnam:

curl -s "https://tariffsapi.com/api/v1/tariffs/resolve?hts=6404.11.90&origin=VN&resolve_chapter_99=true" \
  -H "Authorization: Bearer $TARIFFS_API_KEY"

To price an entry on a future date, add as_of=YYYY-MM-DD. The response contains:

  • base_tariff: the column 1 rate, its type (ad valorem, specific, or compound) and any trade agreement used
  • additional_measures[]: each Chapter 99 measure with its program, code, and resolved rate
  • summary.total_resolved_ad_valorem_rate: the combined ad valorem rate when it can be resolved, or null with a total_declined_reason
  • warnings[]: for example, an HTS code matched by prefix or inherited from a parent line, or a base rate that cannot be calculated
A dotted route from a factory to a ship to a warehouse to a front door, with blocks growing at each stop
Cost builds up at every leg. Duty comes from customs value, not from the running total.

Step 3: Add CBP fees

Most commercial entries pay a merchandise processing fee under 19 CFR 24.23, which has a minimum and maximum per formal entry. Cargo loaded or unloaded from a commercial vessel at most US ports also pays a harbor maintenance fee under 19 CFR 24.24. These are calculated per entry, not per SKU, so allocate them across lines after you add them up.

Step 4: Add logistics and services

Freight, insurance, customs brokerage, drayage, warehousing, and last-mile delivery. These come from your carriers and forwarders, not from tariff data. Allocate shared costs by value, weight, or volume, and pick one method so your margins stay comparable over time.

Putting it together in code

const API = "https://tariffsapi.com/api/v1/tariffs/resolve";

async function resolveDuty({ hts, origin, asOf }) {
  const qs = new URLSearchParams({ hts, origin, resolve_chapter_99: "true", ...(asOf && { as_of: asOf }) });
  const res = await fetch(`${API}?${qs}`, {
    headers: { Authorization: `Bearer ${process.env.TARIFFS_API_KEY}` },
  });
  if (!res.ok) throw new Error(`resolve failed: ${res.status}`);
  return res.json();
}

async function landedCost(line, shipment, feeCfg) {
  const r = await resolveDuty(line);
  const customsValue = line.unitPrice * line.qty; // transaction value, excl. intl freight/insurance

  const rate = r.summary.total_resolved_ad_valorem_rate;
  if (rate == null) {
    return { status: "needs_review", reason: r.summary.total_declined_reason, warnings: r.warnings };
  }

  const duty = customsValue * (rate / 100);
  const freightShare = shipment.freight * (customsValue / shipment.totalValue);
  const feeShare = shipment.cbpFees * (customsValue / shipment.totalValue);

  return {
    status: "ok",
    customsValue,
    duty,
    freightShare,
    feeShare,
    landedCost: customsValue + duty + freightShare + feeShare + line.otherCosts,
    audit: { requestId: r.request_id, htsRevision: r.data_source.hts_revision },
  };
}

Design choices worth copying:

  • A needs_review status, not a zero. Per-unit duties need a quantity and unit, and some rates depend on conditions. The API returns null with a reason instead of guessing. Pass that on to the user.
  • Audit fields. Keep request_id and hts_revision with every quote so you can explain it later.
  • Batch for catalogs. To cost a full catalog, POST /api/v1/tariffs/resolve_batch takes up to 200 items per call on the Developer and Pro plans.
A developer's desk with a laptop showing abstract colored code bars and a parcel beside it
Run landed cost as a service your checkout, ERP, and finance reports all call, so every team sees the same number.

What a landed cost calculator should not hide

  • AD/CVD. Antidumping and countervailing duties apply to specific products from specific producers. They are not in general tariff totals. Screen for them separately.
  • Preferences you haven’t claimed. A free trade agreement rate only applies if the goods qualify and you claim it.
  • Classification risk. The whole calculation rests on the HTS code. If that is wrong, nothing after it is right.

For one-off checks, the tariff calculator runs the same resolution in your browser. Try 8517.13.00.00 for smartphones.

FAQ

What is the formula for landed cost?

Landed cost equals product cost plus international freight and insurance, duties, CBP fees, brokerage, and domestic delivery and handling. For US imports, duty is calculated on customs value, not on the full landed cost.

Is US duty calculated on CIF or FOB value?

US duty is generally based on transaction value under 19 U.S.C. 1401a, the price paid or payable for the goods. International freight and insurance are generally excluded when identified separately. That makes it closer to FOB than CIF, unlike many other countries.

How do I find the duty rate for my product?

Classify the product to its 10-digit HTS code, identify the country of origin, and resolve the base rate plus any Chapter 99 additional measures for the entry date. You can browse codes in the USITC HTS or resolve them in code with an API.

What is the difference between landed cost and customs value?

Customs value is the amount duty is calculated on, generally the transaction value of the goods. Landed cost is the total cost to bring the goods to their destination, which includes customs value plus duties, fees, freight, insurance, and other logistics costs.

Can a landed cost calculator include antidumping duties?

It should flag them, but general tariff data does not include AD/CVD amounts in its totals because those duties depend on the specific producer and case. Screen AD/CVD separately for products that may be covered.

How often should landed cost be recalculated?

Whenever the HTS revision, origin, supplier price, or freight changes, and before any large purchase order. Tariff measures change during the year, so quotes should record the tariff data revision they used.


Build landed cost on resolved, auditable tariff data. Start with the API documentation or see pricing.

This article is general information, not legal or customs advice. Valuation and classification decisions for specific goods should be confirmed with CBP guidance or a licensed customs broker.

Explore the data

Related news