Skip to content

Unit conversions in Zlv

Convert length, mass, speed, time, angles, area, volume, temperature, data sizes and CSS units in Zlv with in or to. Full list of supported unit names.

Put a unit after a number and Zlv keeps track of it. Convert with in, to or as, and Zlv refuses to convert between unrelated kinds, such as kilograms to metres.

Converting

Live example
Edit the lines and press Run. Evaluated in your browser.

Evaluating…

Unit math in the desktop app

The desktop engine carries units through calculations, so you can store a quantity, combine compatible units and convert the result.

Desktop example
Uses the native Rust engine: copy it into Zlv Desktop to see results.

Results appear next to each line in Zlv Desktop. Download it free.

Trying to convert between different kinds of unit, like 5 kg in m, shows an error that names both categories.

Supported units

CategoryUnits (and accepted names)
Lengthmm, cm, m, km, in (inch), ft (foot, feet), yd (yard), mi (mile)
CSS and screenpx, pt, rem, em, vw, vh
Massmg, g, kg (kilo), ton (tonne), oz (ounce), lb (lbs, pound)
Timems, s, min, h (hr, hour), d (day), w (wk, week), mo (month), y (yr, year)
TemperatureC (celsius), F (fahrenheit), K (kelvin)
Areamm2, cm2, m2 (sqm), km2, in2, ft2 (sqft), yd2, mi2, acre, ha (hectare)
Volumeml, l (liter, litre), tsp, tbsp, cup, fl oz, pint, qt, gal, cm3, m3, in3, ft3, yd3
Speedm/s, km/h (kph), mph, knot (kt), ft/s
Angledeg, rad, mrad, grad (gon), turn (rev), arcmin, arcsec
Databit, B (byte), KB, MB, GB, TB, PB, KiB, MiB, GiB, TiB, PiB
Currencysee Currency and exchange rates

Plural forms such as meters, miles, hours and grams are accepted.

Temperature, area and volume

These conversions use the desktop engine. Temperatures convert correctly between scales with different zero points.

Desktop example
Uses the native Rust engine: copy it into Zlv Desktop to see results.

Results appear next to each line in Zlv Desktop. Download it free.

Data sizes

In the desktop engine, KB, MB, GB, TB and PB are decimal (1 GB = 1,000 MB), while KiB, MiB, GiB, TiB and PiB are binary (1 GiB = 1,024 MiB).

Desktop example
Uses the native Rust engine: copy it into Zlv Desktop to see results.

Results appear next to each line in Zlv Desktop. Download it free.

CSS units

px, pt, rem and em use 96 pixels per inch and a 16 px root font size. Change the base size in Settings > Calculation > CSS base font size.

Desktop example
Uses the native Rust engine: copy it into Zlv Desktop to see results.

Results appear next to each line in Zlv Desktop. Download it free.

Angles and trigonometry

Trigonometric functions use degrees by default, so sin(90) is 1. Switch to radians in Settings > Calculation, or tag a value with rad in the desktop app, as in sin(1 rad).

All guides