Modular Scale API
Generate a modular (geometric) scale for typography and spacing. Pick a base size and a ratio — a named musical interval (minor-second, major-second, minor-third, major-third, perfect-fourth, augmented-fourth, perfect-fifth, minor-sixth, golden, major-sixth, minor-seventh, major-seventh, octave and more), a plain number like 1.25, or an interval written as 3:2 — and the scale endpoint returns a harmonious set of sizes stepping up and down from the base, where each value is base × ratio^step (step 0 is the base). Choose how many steps above and below, the rounding, and an optional unit suffix (px, rem, em) so the values come back ready to paste into CSS or design tokens. The ratios endpoint lists every named ratio with its decimal value. A modular scale gives type, spacing and layout a consistent rhythm instead of arbitrary pixel values. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This produces a numeric size scale; for colour scales and gradients use the Gradient API.
api.oanor.com/modularscale-api