{
  "id": "degree",
  "version": "28487b5e2268",
  "status": "published",
  "name": "Degree Calculator",
  "question": "Degree calculator: DMS and decimal",
  "summary": "Converts an angle between degrees, minutes and seconds (DMS) and decimal degrees, with radians, and adds or subtracts two angles in DMS.",
  "category": "math",
  "subcategory": "trigonometry",
  "url": "https://www.acalculator.org/math/degree-calculator",
  "markdown": "https://www.acalculator.org/math/degree-calculator.md",
  "kind": "function",
  "method": "Decimal degrees = d + m ÷ 60 + s ÷ 3,600 (minutes and seconds take the sign of d); radians = degrees × π ÷ 180; sums and differences are taken in arcseconds.",
  "assumptions": [
    "Minutes and seconds are from 0 to less than 60 and take the sign of the degrees: −12° 30′ is −12.5°. For an angle between −1° and 0°, type negative decimal degrees.",
    "Seconds are shown to at most 4 decimals, rounded half up, with a rounded 60″ carried into the minutes."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "mode": {
        "title": "Do",
        "description": "Convert one angle, or add or subtract two angles.",
        "type": "string",
        "enum": [
          "convert",
          "add",
          "subtract"
        ]
      },
      "d": {
        "title": "Degrees",
        "description": "The whole or decimal degrees of the angle. Negative for a negative angle.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "m": {
        "title": "Minutes (′)",
        "description": "The minutes of arc, from 0 to less than 60. Leave empty for none.",
        "type": "number",
        "minimum": 0,
        "exclusiveMaximum": 60
      },
      "s": {
        "title": "Seconds (″)",
        "description": "The seconds of arc, from 0 to less than 60. Leave empty for none.",
        "type": "number",
        "minimum": 0,
        "exclusiveMaximum": 60
      },
      "d2": {
        "title": "Second angle: degrees",
        "description": "The degrees of the angle to add or subtract.",
        "type": "number",
        "minimum": -1000000000,
        "maximum": 1000000000
      },
      "m2": {
        "title": "Second angle: minutes (′)",
        "description": "The minutes of the second angle.",
        "type": "number",
        "minimum": 0,
        "exclusiveMaximum": 60
      },
      "s2": {
        "title": "Second angle: seconds (″)",
        "description": "The seconds of the second angle.",
        "type": "number",
        "minimum": 0,
        "exclusiveMaximum": 60
      }
    }
  },
  "outputs": {
    "decimal": {
      "label": "Decimal degrees",
      "description": "The angle in degrees: degrees + minutes ÷ 60 + seconds ÷ 3,600.",
      "format": "number"
    },
    "dms": {
      "label": "Degrees, minutes, seconds",
      "description": "The angle as d° m′ s″, seconds to at most 4 decimals.",
      "format": "text"
    },
    "radians": {
      "label": "Radians",
      "description": "Decimal degrees × π ÷ 180.",
      "format": "number"
    },
    "normalized": {
      "label": "Between 0° and 360°",
      "description": "The coterminal angle from 0° up to 360°, in decimal degrees.",
      "format": "number"
    },
    "arcsec": {
      "label": "Total arcseconds",
      "description": "The angle in seconds of arc: decimal degrees × 3,600.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "mode": "convert",
      "d": 12,
      "m": 30,
      "s": 45,
      "d2": 5,
      "m2": 45,
      "s2": 30
    },
    "outputs": {
      "decimal": 12.5125,
      "dms": "12° 30′ 45″",
      "radians": 0.21838432265579047,
      "normalized": 12.5125,
      "arcsec": 45045
    },
    "text": "The angle is 12.5125°, or 12° 30′ 45″."
  },
  "examples": [
    {
      "given": {
        "mode": "convert",
        "d": 12,
        "m": 30,
        "s": 45
      },
      "expect": {
        "decimal": 12.5125,
        "dms": "12° 30′ 45″",
        "arcsec": 45045
      },
      "source": "NIST SP 330 (2019), §4 Non-SI units accepted for use with the SI (1° = π/180 rad; 1′ = 1/60°; 1″ = 1/60′). https://www.nist.gov/pml/special-publication-330/sp-330-section-4; hand calculation in content.mdx: 12 + 30 ÷ 60 + 45 ÷ 3,600 = 12.5125°"
    },
    {
      "given": {
        "mode": "convert",
        "d": 40.446195
      },
      "expect": {
        "dms": "40° 26′ 46.302″",
        "decimal": 40.446195
      },
      "source": "NIST SP 330 (2019), §4 Non-SI units accepted for use with the SI (1° = π/180 rad; 1′ = 1/60°; 1″ = 1/60′). https://www.nist.gov/pml/special-publication-330/sp-330-section-4; hand calculation in content.mdx: 0.446195 × 60 = 26.7717′; 0.7717 × 60 = 46.302″"
    },
    {
      "given": {
        "mode": "add",
        "d": 12,
        "m": 30,
        "s": 45,
        "d2": 5,
        "m2": 45,
        "s2": 30
      },
      "expect": {
        "dms": "18° 16′ 15″",
        "decimal": 18.270833333333332
      },
      "source": "NIST SP 330 (2019), §4 Non-SI units accepted for use with the SI (1° = π/180 rad; 1′ = 1/60°; 1″ = 1/60′). https://www.nist.gov/pml/special-publication-330/sp-330-section-4; hand calculation in content.mdx: 45″ + 30″ = 75″ = 1′ 15″; 30′ + 45′ + 1′ = 76′ = 1° 16′; 12° + 5° + 1° = 18°"
    },
    {
      "given": {
        "mode": "subtract",
        "d": 10,
        "m": 0,
        "s": 0,
        "d2": 25,
        "m2": 30,
        "s2": 0
      },
      "expect": {
        "dms": "−15° 30′ 0″",
        "decimal": -15.5,
        "normalized": 344.5
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (radians = degrees × π ÷ 180; coterminal angles). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (coterminal angles: add 360°); hand calculation in content.mdx: 10 − 25.5 = −15.5°; −15.5 + 360 = 344.5°"
    },
    {
      "given": {
        "mode": "convert",
        "d": 800
      },
      "expect": {
        "normalized": 80,
        "radians": 13.962634015954636
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (radians = degrees × π ÷ 180; coterminal angles). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (800° is coterminal with 80°)"
    },
    {
      "given": {
        "mode": "convert",
        "d": 15
      },
      "expect": {
        "radians": 0.2617993877991494
      },
      "source": "OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (radians = degrees × π ÷ 180; coterminal angles). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (15° = π/12)"
    }
  ],
  "sources": [
    "NIST SP 330 (2019), §4 Non-SI units accepted for use with the SI (degree 1° = π/180 rad; minute 1′ = 1/60°; second 1″ = 1/60′). https://www.nist.gov/pml/special-publication-330/sp-330-section-4 (retrieved 2026-10-02)",
    "OpenStax, Algebra and Trigonometry 2e, §7.1 Angles (degrees and radians, θ ÷ 180 = θ_R ÷ π; coterminal angles: 800° is coterminal with 80°). https://openstax.org/books/algebra-and-trigonometry-2e/pages/7-1-angles (retrieved 2026-10-02)"
  ],
  "related": [
    "angle",
    "trigonometry",
    "sine"
  ],
  "changelog": []
}
