Tool Hub

CSS clamp() 計算器

最小/最大字體・視口 → 響應式 clamp() 公式

Preview viewport: 800px

The quick brown fox jumps over the lazy dog.

24.00px @ 800px

CSS
font-size: clamp(1.000rem, 1.6667vw + 0.6667rem, 2.000rem);

使用方法

  1. Enter the minimum font size in pixels and the maximum font size in pixels。
  2. Enter the minimum viewport width and the maximum viewport width where those font sizes apply。
  3. Drag the preview slider to simulate how the font scales at different viewport widths and read the live pixel value。
  4. Copy the generated clamp() expression and paste it into your CSS。

範例

  • Min font 16px, max font 32px, min viewport 320px, max viewport 1280px produces clamp(16px, 1.667vw + 10.667px, 32px)。
  • At a 800px preview viewport the live display shows approximately 23px, confirming smooth scaling between the two extremes。

生產環境使用前請驗證輸出。無擔保 — 參見 條款.