{
  "id": "square",
  "version": "ef590406cd29",
  "status": "published",
  "name": "Square Calculator",
  "question": "What is the square’s area?",
  "summary": "Finds every measure of a square from any one of them: side, perimeter, area, diagonal, and the radii of the inscribed and circumscribed circles.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/square-calculator",
  "markdown": "https://www.acalculator.org/math/square-calculator.md",
  "kind": "formulas",
  "method": "P = 4s; A = s²; d = s√2 (Pythagorean theorem: d² = s² + s²); r = s ÷ 2; R = d ÷ 2 = s√2 ÷ 2.",
  "assumptions": [
    "All four sides are equal and every corner is a right angle.",
    "Type one measure; the side follows from it, and every other measure from the side.",
    "Lengths are in the unit shown next to each field and the area in the area unit shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "s": {
        "title": "Side (s)",
        "description": "The length of one side of the square.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      },
      "p": {
        "title": "Perimeter (P)",
        "description": "The distance around the square: four sides.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 4000000000
      },
      "a": {
        "title": "Area (A)",
        "description": "The space inside the square: side times side.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "area",
        "exclusiveMinimum": 0,
        "maximum": 1000000000000000000
      },
      "d": {
        "title": "Diagonal (d)",
        "description": "The distance from one corner to the opposite corner.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 2000000000
      },
      "r": {
        "title": "Inradius (r)",
        "description": "The radius of the circle that touches all four sides: half the side.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 500000000
      },
      "cr": {
        "title": "Circumradius (R)",
        "description": "The radius of the circle through all four corners: half the diagonal.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000000000
      }
    }
  },
  "solve": {
    "fillAny": 1,
    "variables": [
      "s",
      "p",
      "a",
      "d",
      "r",
      "cr"
    ],
    "inputsOnly": []
  },
  "outputs": {
    "s": {
      "label": "Side (s)",
      "description": "The length of one side of the square.",
      "format": "quantity"
    },
    "p": {
      "label": "Perimeter (P)",
      "description": "The distance around the square: four sides.",
      "format": "quantity"
    },
    "a": {
      "label": "Area (A)",
      "description": "The space inside the square: side times side.",
      "format": "quantity",
      "unit": "in2"
    },
    "d": {
      "label": "Diagonal (d)",
      "description": "The distance from one corner to the opposite corner.",
      "format": "quantity"
    },
    "r": {
      "label": "Inradius (r)",
      "description": "The radius of the circle that touches all four sides: half the side.",
      "format": "quantity"
    },
    "R": {
      "label": "Circumradius (R)",
      "description": "The radius of the circle through all four corners: half the diagonal.",
      "format": "quantity"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "s": 0.127
    },
    "outputs": {
      "p": 0.508,
      "a": 0.016129,
      "d": 0.17960512242138307,
      "r": 0.0635,
      "R": 0.08980256121069154
    },
    "text": "A square with side 5 in has a perimeter of 20 in, an area of 25 in² and a diagonal of 7.071 in."
  },
  "examples": [
    {
      "given": {
        "s": 5
      },
      "expect": {
        "p": 20,
        "a": 25,
        "d": 7.0710678118654755,
        "r": 2.5,
        "cr": 3.5355339059327378
      },
      "source": "hand calculation in content.mdx: 4 × 5 = 20, 5² = 25, 5√2 = 7.0711; OpenStax, Contemporary Mathematics, §10.4 Polygons, Perimeter, and Circumference (P = n·s; a square has n = 4). https://openstax.org/books/contemporary-mathematics/pages/10-4-polygons-perimeter-and-circumference; OpenStax, Contemporary Mathematics, §10.6 Area (A = s² for a square). https://openstax.org/books/contemporary-mathematics/pages/10-6-area; OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem (a² + b² = c²). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem"
    },
    {
      "given": {
        "p": 120
      },
      "expect": {
        "s": 30,
        "a": 900,
        "d": 42.42640687119285
      },
      "source": "hand calculation in content.mdx: 120 ÷ 4 = 30, 30² = 900; OpenStax, Contemporary Mathematics, §10.4 Polygons, Perimeter, and Circumference (P = n·s; a square has n = 4). https://openstax.org/books/contemporary-mathematics/pages/10-4-polygons-perimeter-and-circumference"
    },
    {
      "given": {
        "a": 49
      },
      "expect": {
        "s": 7,
        "p": 28,
        "d": 9.899494936611665
      },
      "source": "hand calculation in content.mdx: √49 = 7; OpenStax, Contemporary Mathematics, §10.6 Area (A = s² for a square). https://openstax.org/books/contemporary-mathematics/pages/10-6-area"
    },
    {
      "given": {
        "d": 10
      },
      "expect": {
        "s": 7.071067811865475,
        "a": 49.99999999999999,
        "cr": 5
      },
      "source": "hand calculation in content.mdx: s = 10 ÷ √2 = 7.0711, A = d² ÷ 2 = 50; OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem (a² + b² = c²). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem"
    }
  ],
  "sources": [
    "OpenStax, Contemporary Mathematics, §10.4 Polygons, Perimeter, and Circumference (P = n·s for a regular polygon; a square table 30 inches across). https://openstax.org/books/contemporary-mathematics/pages/10-4-polygons-perimeter-and-circumference (retrieved 2026-10-02)",
    "OpenStax, Contemporary Mathematics, §10.6 Area (A = s·s = s² for a square). https://openstax.org/books/contemporary-mathematics/pages/10-6-area (retrieved 2026-10-02)",
    "OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem (a² + b² = c²). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem (retrieved 2026-10-02)"
  ],
  "related": [
    "area",
    "hexagon",
    "pythagorean-theorem",
    "square-footage"
  ],
  "changelog": []
}
