{
  "schemaVersion": 1,
  "slug": "frequency-calculator",
  "category": "conversion",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "be1013ee12e738c67dd2d39130a9b220972b56ac6e889a7008842d5f12e9e45d",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/frequency-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "f = v x F[s] / F[t]; T_ms = 1000 / f; λ_m = 299792458 / f",
    "vars": [
      [
        "v",
        "input frequency value"
      ],
      [
        "s",
        "source unit"
      ],
      [
        "t",
        "target unit"
      ],
      [
        "F",
        "unit factor: Hz 1, kHz 10^3, MHz 10^6, GHz 10^9"
      ],
      [
        "f",
        "frequency in Hz"
      ],
      [
        "T_ms",
        "period in milliseconds"
      ],
      [
        "λ_m",
        "wavelength in metres (vacuum)"
      ]
    ],
    "note": "T = 1,000 ÷ f gives milliseconds; λ = 299,792,458 ÷ f gives metres in vacuum. The speed of light is exact in vacuum; media such as air and cable reduce propagation speed. At f = 0, period and wavelength have no finite value."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "NIST SP 811 — Conversion factors by quantity",
        "url": "https://www.nist.gov/pml/special-publication-811/nist-guide-si-appendix-b-conversion-factors/nist-guide-si-appendix-b9"
      }
    ],
    "basis": "Convert frequency via hertz; rpm is divided by 60 for cycles per second.",
    "limitations": "Only the displayed unit definitions are converted; rounding and measurement uncertainty are separate.",
    "implementationHash": "be1013ee12e738c67dd2d39130a9b220972b56ac6e889a7008842d5f12e9e45d",
    "domain": "conversion"
  },
  "contract": {
    "compute": "const units={\"hz\":\"Hz\",\"khz\":\"kHz\",\"mhz\":\"MHz\",\"ghz\":\"GHz\"}, factors={\"hz\":1,\"khz\":1000,\"mhz\":1000000,\"ghz\":1000000000}; if(!Number.isFinite(value)||value<0||value>1000000000000000000||!Object.prototype.hasOwnProperty.call(units,from)||!Object.prototype.hasOwnProperty.call(units,to))return {\"result\":null,\"hz\":null,\"periodMs\":null,\"wavelengthM\":null,\"__error\":\"inputError\"}; const out=(function(){const F={hz:1,khz:1000,mhz:1e6,ghz:1e9}; const hz=value*F[from]; return { result: hz/F[to], hz, periodMs: hz>0 ? 1000/hz : null, wavelengthM: hz>0 ? 299792458/hz : null };})(); if(out.__error)return {...{\"result\":null,\"hz\":null,\"periodMs\":null,\"wavelengthM\":null},...out}; out.__resultUnit=units[to]; out.__unitRatio=factors[to]/factors[from]; return out;",
    "inputs": [
      {
        "name": "value",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 1000000000000000000,
        "step": 0.0001,
        "requiredValue": true,
        "strictRange": true
      },
      {
        "name": "from",
        "type": "select",
        "default": "ghz",
        "options": [
          {
            "value": "ghz"
          },
          {
            "value": "hz"
          },
          {
            "value": "khz"
          },
          {
            "value": "mhz"
          }
        ]
      },
      {
        "name": "to",
        "type": "select",
        "default": "mhz",
        "options": [
          {
            "value": "mhz"
          },
          {
            "value": "hz"
          },
          {
            "value": "khz"
          },
          {
            "value": "ghz"
          }
        ]
      },
      {
        "name": "precision",
        "type": "select",
        "default": 4,
        "options": [
          {
            "value": 0
          },
          {
            "value": 2
          },
          {
            "value": 4
          },
          {
            "value": 6
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "result",
        "precision": 4,
        "unit": "",
        "precisionField": "precision",
        "unitField": "__resultUnit",
        "trimTrailingZeros": true,
        "notation": "auto"
      },
      {
        "name": "hz",
        "precision": 4,
        "unit": "Hz",
        "showWhen": {
          "to": [
            "khz",
            "mhz",
            "ghz"
          ]
        },
        "notation": "auto"
      },
      {
        "name": "periodMs",
        "precision": 15,
        "unit": "ms",
        "notation": "auto"
      },
      {
        "name": "wavelengthM",
        "precision": 12,
        "unit": "m",
        "notation": "auto"
      }
    ],
    "interpret": null
  }
}
