ForHosting KIT · Finance & money

Credit spread calculator

Subtract the matched Treasury yield from a bond's yield and read the gap in basis points: a 5.5% corporate yield over a 4% benchmark is a credit spread of 150 basis points. Works with percent or decimal quotes. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Corporate yield
5.5
Risk free yield
4
You get
Yield unit
Percent
Spread percent
1.5
Spread bps
150

Credit spread is the extra yield a corporate bond pays over a risk-free benchmark of similar maturity, quoted in basis points so that one percent equals one hundred basis points. Analysts, lenders, and students use that gap as a compact credit-risk number: a name trading 180 basis points over the matched Treasury is 1.80 percentage points richer than the risk-free curve. This credit spread calculator accepts a corporate bond yield and a risk-free benchmark yield as finite numbers, subtracts the benchmark from the corporate quote, and converts the difference into basis points.

What a credit spread is and how basis points are scaled

A credit spread is the extra yield investors demand to hold a corporate or other credit-risky bond instead of a risk-free government benchmark of similar remaining maturity. Market convention reports that extra yield in basis points, where one hundred basis points equal one percentage point: a 5.50 percent corporate yield against a 4.00 percent Treasury yield is a 150 basis-point credit spread. The figure compresses credit risk, liquidity, and any non-Treasury features of the issue into a single comparable quote used on term sheets, relative-value screens, and exam problems.

When yields arrive as percent quotes (the default), subtracting them and multiplying by one hundred converts percentage points into basis points. When they arrive as decimals, the multiplier is ten thousand because 0.01 in decimal form is already one percent. Negative spreads are valid: a name that trades through the benchmark, or a tax-advantaged municipal compared with a taxable Treasury on a pre-tax basis, can print below zero.

The tool does not fetch live quotes, ratings, or curves; it applies the identity to the two finite yields you supply so homework keys, landing-page widgets, and automation share one auditable basis-point figure.

Where a credit spread calculator earns its keep

Credit analysts and loan desks use the same figure when a client asks how many basis points a BBB industrial sits over the matched Treasury, or when a bank prices a floating facility as a spread over a government benchmark rather than as an all-in yield. Educators and CFA or FRM study platforms need a deterministic oracle for fixed-income homework that asks students to convert a corporate yield and a risk-free yield into basis points, including the percent-versus-decimal trap and the legitimate negative-spread case.

Content teams can contrast the simple yield spread with OAS or Z-spread on a callable bond so readers see why stripping optionality changes the number. Failed validation does not consume balance. Keep both yields finite, pin the rounded spread fields in tests, and you get reproducible credit spreads for widgets, classrooms, and production without standing up a fixed-income library of your own.

Relative-value credit screens

Turn a corporate yield and a matched Treasury yield into the basis-point credit spread a desk compares across issuers, ratings, and tenors.

Loan and facility pricing

Quote a floating facility or a fixed corporate issue as a spread over a government benchmark instead of as an all-in yield alone.

Fixed-income homework and CFA keys

Mark problems that convert two yields into basis points, including decimal quotes and negative spreads, with a deterministic oracle.

How is a credit spread calculated?

Subtract the risk-free benchmark yield from the corporate bond yield. When yields are percent quotes, multiply the difference by 100 to get basis points (5.5 minus 4.0 is 150 bps). When yields are decimals, multiply by 10,000 (0.055 minus 0.040 is 150 bps).

Should I enter yields as percents or as decimals?

Mixing a percent quote with a decimal quote without changing the unit will produce a nonsense spread.

Can the credit spread be negative?

Yes. If the corporate yield is below the risk-free yield the spread is negative. That can happen when a name trades through the benchmark or when a tax-advantaged municipal is compared with a taxable Treasury on a pre-tax basis.

What does a spread of 180 basis points mean?

It means the bond yields 1.80 percentage points more than the matched government benchmark, because one hundred basis points make one percentage point. The wider the gap, the more extra yield investors demand for the credit risk.

Is this the same as an option-adjusted spread or a Z-spread?

No. It is the simple yield-minus-yield gap. An option-adjusted spread, a Z-spread or a spread over swaps discount along a whole curve or strip out embedded options, which needs cash-flow schedules this calculator does not take.

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.

POSThttps://api.kit.forhosting.com/fin/credit-spread

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.

curl -X POST https://api.kit.forhosting.com/fin/credit-spread \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"corporate_yield":5.5,"risk_free_yield":4}'
{
  "corporate_yield": 5.5,
  "risk_free_yield": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "fin.credit_spread",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Either yield that is missing, empty, or not a finite number fails with invalid_input instead of inventing a spread. Optional yield_unit chooses percent quotes (five point five for 5.5 percent, the default) or decimal rates (0.055 for the same yield).

What a credit spread is and how basis points are scaled

This calculator is the textbook yield-minus-yield identity, not an option-adjusted spread, a Z-spread over a spot curve, or an I-spread over swaps; those constructions discount along a whole curve or strip embedded options and need cash-flow schedules this endpoint does not take.

Input contract, response shape, and error behaviour

Percent means market quotes such as 5.5 for five and a half percent; decimal means 0.055 for the same rate. Optional decimals is an integer from zero through twelve (default six) controlling half-up rounding on the numeric outputs. POST a JSON body with two required finite numbers: corporate_yield, the corporate or other risky bond yield, and risk_free_yield, the matched risk-free benchmark yield. Aliases corporate_bond_yield, y_corp, and yield_corporate are accepted for the first field; risk_free_rate, y_rf, treasury_yield, and benchmark_yield for the second. Optional yield_unit is an enum of percent (default) or decimal. On success the body echoes the parsed yields and the unit, then returns spread_percent (the difference in percentage points) and spread_bps (that difference times one hundred), plus a formula string restating the identity used. Example: corporate_yield 5.5, risk_free_yield 4.0, yield_unit percent produces a 1.5 percentage-point gap and a 150 basis-point credit spread. Missing fields, empty strings, booleans, or non-finite values such as NaN and infinities fail with invalid_input naming the field and are not billed. Pair the response with your own curve data if you need a duration-matched Treasury; this endpoint subtracts the two numbers you already chose.

Where a credit spread calculator earns its keep

Integrators wire the endpoint into notebooks, n8n flows, or edge workers to pin goldens whenever a pricing spreadsheet changes.

What happens if either yield is not a finite number?

The task fails with invalid_input naming the field. Missing, empty, boolean, NaN, or infinite yields are not a well-posed spread, so no number is invented and the call is not billed.

What does the credit spread calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →