All tools βΊ Values and arithmetic
Units side by side
One size in every unit it can be written in, with what each one is measured against.
It runs entirely in this browser tab: the CSS you paste is never uploaded, and the preview is drawn from the same numbers the rule carries rather than rendered by the browser β which is why a tool whose effect only exists in a compositor says so instead of drawing one.
Settings
- Root font size
- Sixteen pixels everywhere, unless the reader changed it β which is the whole point of `rem`. A number from 8 to 32.
- Viewport width
- What a viewport unit is a hundredth of. A number from 320 to 4000.
- Containing block
- What a percentage is a hundredth of. A number from 100 to 4000.
How to use it
- Paste your text into the box above, or open a file.
- Adjust the settings beside it until the result is what you wanted.
- Copy the result, or save it as a file. The result updates as you type.
Questions
- Is what I paste uploaded anywhere?
- No. The whole application is carried as WebAssembly and runs on your own device. There is no server to send a stylesheet to, and no tool here makes a network request while it works.
- Is the preview what my browser will actually draw?
- For a colour, a shape and a curve, yes β it is drawn from the same numbers the rule carries. For anything a browser's compositor does against the page behind it β a backdrop filter, a blend mode, a scrollbar β no, and that tool says so on its own result rather than showing you an approximation.
- Why does a size come out as 1.125rem and not 1.1250000000000002rem?
- Because none of the arithmetic is done in binary floating point. Every length here is an exact decimal, so a conversion ends where it should: 18px is 1.125rem and 24px is 18pt, with no run of nines and no stray four at the twelfth place.
- Can I use these rules without attribution?
- Yes. What comes out is CSS β a declaration is not a work with an owner, and nothing here writes a comment into your stylesheet about where it came from.
Other tools for values and arithmetic
Fluid size
A size that scales between two screen widths, worked out exactly rather than in floating point.
Selector specificity
How loudly a selector claims a property β three numbers that are not one number.
Rules to classes
Declarations as the utility classes that stand for them, with the ones that have none named.
Sort a sheet
Declarations put in order, with the repeats that would change meaning kept the right way round.
Drawing to background
A drawing as a data address a background can use, escaped only where it has to be.
All twenty-seven tools