CSS Typed Arithmetic Playground

Test if your browser can divide CSS units — calc(100vw / 1px) and friends — then play with live typed expressions.

Not tested yet

This test asks your browser to actually compute typed calc() expressions — no guessing from version numbers.

Live: your viewport as a number

The bar below is faded by pure CSS — opacity: clamp(0.08, calc((100vw / 1px - 320) / 1120), 1) — no JavaScript touches it. Resize this window and watch it respond. If your browser lacks typed arithmetic the declaration is dropped and the bar stays fully solid.

Viewport width: – · unitless ratio (0 at 320px, 1 at 1440px): –

Playground

Write any calc() expression, apply it to a real CSS property on the preview box, and read back the resolved value your browser computes.

Preview

Resolved value: –

What is CSS typed arithmetic?

CSS values carry types: lengths (px, vw, rem), angles (deg, turn), times (s, ms), percentages and plain numbers. Classic calc() was strict about them — you could divide a length by a number, but never by another length, because the result (a squared or cancelled unit) had no meaning in the old model. Typed arithmetic upgrades calc() with real type algebra: when you divide two values of the same type, the units cancel and the result is a unitless number.

That one change unlocks a pattern developers used to need JavaScript for. calc(100vw / 1px) reads the viewport width as a plain number. Normalize it between two breakpoints and you get a 0-to-1 progress value, computed entirely in CSS, that can drive opacity, rotation, scale, hue — any property that accepts a number or can be multiplied from one. Scroll-free parallax, viewport-reactive interfaces and fluid design systems all get simpler.

Browser support

Typed arithmetic shipped in Chrome and Edge 140, Safari 26, and Firefox 158 (October 2026), which puts it within reach of roughly 84% of global browser usage. It is progressive enhancement by nature: in an older browser the declaration is simply invalid and dropped, so always pair it with a sensible default value declared first. The test at the top of this page checks your actual browser rather than a version chart, because channels, flags and embedded webviews do not always match the headline numbers.

What typed arithmetic still cannot do

Multiplying two typed values stays invalid — calc(10px * 2px) would be square pixels, which no property accepts. Division by a value of a different type is equally invalid: a length divided by a time would be a speed, and CSS has no speed type. The playground above lets you feel these edges safely: try breaking an expression and watch your browser reject it.

How to use this tool

  1. Click Test My Browser — the probes run automatically on load, too. Each probe asks your browser to compute a real typed expression.
  2. Read the probe table: green ticks mean same-type division, viewport-as-number and ratio-driven angles all work on this device.
  3. Watch the live bar: it is faded by pure CSS typed arithmetic. Resize the window and compare it with the JavaScript-computed ratio beside it.
  4. In the playground, pick a preset or write your own calc(), choose a property, and hit Apply to see the resolved value your browser computes.
  5. Copy the support report if you need it for a bug report or a team compatibility check.

Frequently Asked Questions

Typed arithmetic is the upgrade to CSS calc() that understands value types. When you divide two values of the same type — two lengths, two angles, two times — the units cancel and the result is a unitless number. It lets CSS compute ratios natively, such as reading the viewport width as a plain number with calc(100vw / 1px), which previously required JavaScript.
Chrome and Edge from version 140, Safari from version 26, and Firefox from version 158 (released October 2026), plus Samsung Internet 30 and current mobile browsers — roughly 84% of global usage. The test on this page checks your real browser instead of relying on version lists.
It converts the viewport width into a unitless number you can compute with. Normalize it between two breakpoints — subtract the minimum, divide by the range — and you get a 0-to-1 progress value that can drive opacity, rotation, scale or color, all in pure CSS with no JavaScript and no scroll listeners.
No. Multiplication still requires one side to be a unitless number. Two lengths multiplied would be square pixels, a unit no CSS property accepts, so browsers reject the declaration. Typed arithmetic adds same-type division (and type-aware results); it does not make every combination of units legal.
For presentation logic, often yes: viewport-driven opacity, rotation, sizing relationships and fluid effects that used to need a resize listener now take a few lines of CSS. JavaScript is still the right tool for real interaction state, data and anything beyond computed presentation values.

Was this tool helpful?

Comments

Loading comments...

Check Out Other Popular Tools