Skip to content
Calculator Tools

Tech & Media · 11 calculators

CSS & Design Calculators

Convert RGB, HEX and HSL colours, check contrast ratios, build type and spacing scales, line heights and font sizes.

Key css & design formulas

RGB to HEX ConverterEach channel is written as two hexadecimal digits, 00 to FF
HEX to RGB ConverterEach pair of hex digits is one channel value from 0 to 255
HSL to HEX ConverterHSL is converted to RGB through chroma, then written as hex
HEX to HSL ConverterRGB is normalised, then hue, saturation and lightness are derived from the channel extremes
Contrast Ratioratio = (L_lighter + 0.05) ÷ (L_darker + 0.05)
Aspect RatioW : H = (W ÷ GCD) : (H ÷ GCD) · H = W × b ÷ a
Golden Ratioφ = (1 + √5)/2 ≈ 1.6180339887 · a/b = (a+b)/a = φ
Type Scalesize = base × ratio^step
Line Heightline-height ratio = line height ÷ font size
Font Size Converterpx = pt × 96 ÷ 72 · rem = px ÷ root font size

CSS & Design questions

What contrast ratio do I need?

4.5:1 for body text and 3:1 for large text or UI controls to meet WCAG AA, which is the level most accessibility regulations reference.

What are the common aspect ratios?

16:9 for HD video and most monitors, 4:3 for older TVs and iPads, 21:9 for ultrawide displays, 1:1 for square social posts, 9:16 for vertical video and 3:2 for many camera sensors.