Skip to content

Units

A number can carry a unit. Write the unit after the number.

5 m
3 hours
72 kg

Every unit belongs to a dimension such as Length, Time, or Mass. Arithmetic carries dimensions through, and smoot checks them.

5 m + 30 cm
1 km + 500 m
3 m * 4 m
10 m / 2 s
100 km / 2 hour

Adding a length to a mass is an error, not a number. This is the rule that makes smoot trustworthy: a dimension mistake is always reported, never silently coerced.

5 m + 3 kg

The left operand’s unit wins the display: 1 km + 500 m shows kilometres. Powers and roots carry dimensions too.

(3 m) ^ 2
sqrt(9 m^2)

to converts a value into another unit.

12 inch to cm
1 mile to km
60 mph to kph
3.6 km/hour to m/s
5 m^2 to cm^2

in reads better in some sentences. It works like as: the answer is shown in the new unit and the value keeps its own. To convert a value you give a name, use to.

1 lb in g

Converting across dimensions is the same dimension error as adding them.

5 kg to m

Prefixes are generated for every metric unit, so km, cm, mm, µm, ms, µs, mg, kJ, MW, and GB all exist. Type µ or u; both work.

1 km to m
500 ms to s
5 um to m
2 GB to MB

Long names work with long prefixes: kilometre, millisecond, megabyte.

Two quantities of the same dimension written side by side add up.

5 ft 6 inch
5 ft 6 inch to cm
3 hours 45 minutes to minutes

To display a value across several units, give to a comma list. smoot peels off the largest unit first.

2.5 ft to ft, inch
90 minutes to hour, minute
2250 g to kg, g

A unit group is a named list that spans several dimensions. The prelude ships metric, imperial, and us; each picks the members that fit the value’s dimension.

5432 m to metric
80 kg to imperial to 0 dp
0 C to imperial

The trailing to 0 dp rounds the last component; see Formatting.

Celsius and Fahrenheit have offsets, and smoot keeps the arithmetic physical. Subtracting two temperatures gives a difference; adding a difference to a temperature gives a temperature.

100 C to F
98.6 F to C
300 K to C
100 C - 50 C
20 C + 5 C
DimensionUnits
Lengthm and prefixes, inch, ft, yard, mile, nautical mile, au, light year, parsec
Times and prefixes, minute, hour, day, week, month, year
Masskg, g and prefixes, tonne, lb, oz, stone, ton, carat
TemperatureK, C, F
Angleradian, deg, arcmin, arcsec, turn, gradian
Aream^2 and friends, hectare, acre
Volumel and prefixes, m^3, cup, tablespoon, teaspoon, pint, quart, gallon, imperial imppint, impgallon
Speedmph, kph, any length/time
Energy, PowerJ, cal, kcal, Wh, kWh, W, hp
PressurePa, bar, atm, mmHg, psi
DataB, byte, bit, kBTB, KiBTiB
ElectricalA, V, ohm and prefixes, coulomb
Amount, Frequency, Lightmol, Hz, candela, lumen, lux

Most units have long names and plurals: metres, feet, hours, pounds. Answers show a unit’s primary spelling in the singular, whichever alias you typed: 12 months to years reads 1 year, 500 mL reads 500 ml. To choose the spelling a unit displays with, declare it: unit mL = ml makes every millilitre in the document read mL.

The kitchen units are US volumes: cup, pint, gallon. The imperial ones are prefixed: imppint, impgallon.