What is a type scale?
A type scale is a set of font sizes where each step is the previous one multiplied by the same ratio. Instead of choosing 18, 22 and 31 pixels at random, sizes relate to each other the way notes in music do, which makes a page's headings and text feel deliberate and balanced.
Enter a base size and pick a ratio from minor second to golden ratio. The generator lists every step with its pixel and rem size, previews it with your own words, suggests line heights, and can make the whole scale fluid with clamp().
How to use the Type scale generator
1.Set base and ratio
16 px with a ratio like 1.25 is a common starting point.
2.Choose the steps
How many sizes above and below the base, and rem or px.
3.Copy the CSS
Custom properties for each size and its line height.
Example: a 1.25 scale from 16 px
Base 16 px, major third ratio (1.25), rem units:
- sm
- 12.8px (0.8rem)
- base
- 16px (1rem)
- lg / xl
- 20px / 25px
- 2xl / 3xl
- 31.25px / 39.06px
size = base × ratio^step
Each heading level is a quarter bigger than the one below, giving a calm, readable hierarchy.
Fluid sizes with clamp()
Turn on fluid sizes to use a smaller base and ratio on phones and a larger one on desktops. Each step becomes a clamp() value that grows smoothly between 360 px and 1280 px wide screens, so headings shrink on phones without media queries.
Line heights are suggested per size: roomy 1.5 for body text, tightening to 1.1 for large display headings, which keeps big type from looking loose.
Frequently asked questions
Which ratio should I pick?
1.2 to 1.25 suits text-heavy sites and apps; 1.333 to 1.618 gives dramatic headings for marketing pages.
Why use rem instead of px?
rem sizes follow the reader's browser font setting, which helps people who need larger text.
What are the step names?
T-shirt sizes like sm, base, lg and 2xl, similar to many CSS frameworks. Rename them freely.
Can I share my scale?
Yes. Every setting is stored in the page address.
Related tools
CSS clamp() Generator for Fluid Sizes
Fluid font sizes and spacing that scale between two viewport widths.
px to rem Converter
Convert pixels to rem and rem to pixels for any root font size.
Font pairing
Preview heading and body font combinations from Google Fonts.
Aspect Ratio Calculator
Find an image or video's aspect ratio and resize it without distortion.
PPI Calculator (Pixel Density)
Pixel density of a screen from its resolution and diagonal size.
Font inspector
See a font file's names, licence, glyphs and language support.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table