This REST API converts between Failure Rate (%), DPPM (Defective Parts Per Million), Sigma (1-sided), and defect ratio inputs. Provide any one input value and the API returns all corresponding calculated metrics.
POST https://www.promptbox.cn/api/dppm.php
Send a JSON body with at least one of the following fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
failure_rate |
number | No | Failure rate as a percentage (0 ≤ value < 100). Example: 0.01 for 0.01%. |
dppm |
number | No | DPPM (Defective Parts Per Million). Example: 100. |
sigma |
number | No | Sigma value (1-sided, manufacturing convention). Example: 3.72. |
defects |
number | No | Observed number of defective units. |
total |
number | No | Total number of units tested. Must be > 0. Used together with defects. |
defects + total → failure_rate → dppm → sigma.
{
"failure_rate": 0.01
}
The API responds with a JSON object containing normalized results:
| Field | Type | Description |
|---|---|---|
failure_rate_percent |
number | Failure rate as a percentage. |
dppm |
number | DPPM (defects per million). |
sigma_one_sided |
number | Equivalent 1-sided sigma value. |
method |
string | Indicates which input method was used (e.g., defects_ratio, failure_rate_input, dppm_input, sigma_input). |
{
"failure_rate_percent": 0.01,
"dppm": 100,
"sigma_one_sided": 3.72,
"method": "failure_rate_input"
}
If input values are invalid, the API responds with an error:
{
"error": "Invalid DPPM value."
}
failure_rate is expected as a percentage (0–100). Example: 0.01 means 0.01% (1e-4 as a decimal).dppm must be between 0 and 1,000,000.sigma input is 1-sided; conversion uses the standard normal distribution tail probability.defects and total are used together to compute the defect ratio.