跳到主要内容

正方形面积计算器

根据边长计算正方形的面积、周长和对角线 — 面积 = 边长²,周长 = 4 × 边长,对角线 = 边长 × √2。支持选择任意单位(仅用作标签展示,不作换算)。

输入

输出

结果
指标数值
No data yet
这对您有帮助吗?

使用指南

A square is the simplest shape to measure: every side is the same length, so one number — the side length — is enough to derive everything else about it. This calculator takes that single measurement and returns the area, perimeter and diagonal at once.

The formulas

For a square with side length s:

Area      = s²
Perimeter = 4 × s
Diagonal  = s × √2

Area comes from multiplying the side by itself, since a square's width and height are identical. Perimeter is just the four equal sides added together. The diagonal follows from the Pythagorean theorem: it's the hypotenuse of a right triangle formed by two sides, so it works out to the side length times the square root of 2 (≈ 1.41421356).

Worked example: a square with a 5 cm side has an area of 25 cm², a perimeter of 20 cm, and a diagonal of roughly 7.07 cm.

How to use it

  1. Enter the side length of your square.
  2. Pick a unit (millimeters, centimeters, meters, kilometers, inches, feet, or yards) — this is purely a label on the results, since area, perimeter and diagonal are all calculated in whatever unit you entered the side in. No unit conversion is applied.
  3. Area, perimeter and diagonal update instantly as you type.

FAQ

Does the unit dropdown convert my measurement? No. It labels the output (e.g. "cm" vs "in") but performs no conversion — the side length you enter and the results you get are in the same unit. If you need to convert between units first, use a length converter, then paste the result here.

Why does area use a squared unit (cm²) but perimeter and diagonal don't? Area measures a two-dimensional surface, so its unit is squared (length × length). Perimeter and diagonal are both one-dimensional distances, so they stay in the plain unit you entered.

What if I enter a negative or blank side length? The calculator requires a non-negative side length before it will compute a result; a blank or invalid entry simply produces no output rather than an error.

Can I use this for a rectangle instead? No — this tool assumes all four sides are equal. For a rectangle (different length and width), you'd need separate length × width and 2 × (length + width) formulas.

How precise are the results? Values are rounded to two decimal places, which is precise enough for most everyday and classroom use. The underlying calculation itself is exact; only the displayed figure is rounded.

Privacy

Everything runs locally in your browser — the side length you enter is never uploaded or stored anywhere.

areasquareperimeterdiagonalgeometrymath

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/area-of-square-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "sideLength": "5",
    "unit": "cm"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `area-of-square-calculator` tool (Area of Square Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

喜欢这些工具?去掉广告吧。

一次性付款即可永久移除您账户中的所有广告。无需订阅,不追踪。