December 3, 2026
To copy a website's text style you need five values, not one: the font family, the weight, the size, the line height and the letter spacing. All five are in the Computed tab of DevTools for any text you inspect. They come out in pixels, so two of them need a small sum before they are reusable CSS.
How do I read the five values?
- Right-click the text and choose Inspect.
- Open the Computed tab and type
fontin its filter box. - Note
font-family,font-weightandfont-size. - Change the filter to
lineforline-height, thenletterforletter-spacing. - Scroll to Rendered Fonts at the bottom to confirm which font in the family list was really drawn.
How do I turn the pixel values into good CSS?
Say the Computed tab shows a heading at font-size: 48px, line-height: 52.8px and
letter-spacing: -0.96px.
| Value | Computed | Sum | Write this |
|---|---|---|---|
| Line height | 52.8px | 52.8 ÷ 48 | line-height: 1.1 |
| Letter spacing | -0.96px | -0.96 ÷ 48 | letter-spacing: -0.02em |
| Font size | 48px | 48 ÷ 16 | font-size: 3rem |
Ratios matter because they still work when the size changes. A line height fixed at 52.8 pixels breaks the moment the heading shrinks on a phone. A line height of 1.1 does not.
h1 {
font-family: "Inter", system-ui, sans-serif;
font-weight: 600;
font-size: 3rem;
line-height: 1.1;
letter-spacing: -0.02em;
}
Why does the size change when I resize the window?
Many sites set type with clamp() or viewport units so it grows with the window. The Computed tab only shows the
answer at your current width. To copy the behaviour, find the rule in the Styles tab, or measure the size at a phone width
and at a desktop width and write your own clamp() between the two.
What else can change how text looks?
text-transform: small labels are often uppercase with wide letter spacing.font-variation-settingsandfont-optical-sizing: variable fonts can sit between named weights, such as 450.font-feature-settings: alternate letters, tabular numbers and ligatures.-webkit-font-smoothing: makes light text on dark backgrounds look thinner on a Mac.
How do I get every text style on a page?
A page has a scale: a handful of sizes used again and again. Reading them one element at a time is slow. The design token extractor reads the type scale, colors and spacing of a rendered page in one go, and this guide turns the result into a Tailwind theme.
Where to go next
- How to identify fonts on a website (4 methods).
- How to see a website's CSS variables.
- Can you download a font from a website?
FAQ
How do I find the font size on a website?
Right-click the text, choose Inspect, open the Computed tab and read font-size. The value is in pixels at your current window width. Many sites scale type with the window, so check again at a phone width.
How do I find the line height and letter spacing of text on a website?
They are in the same Computed tab as line-height and letter-spacing. Both appear in pixels. Divide each by the font size to get the ratio the designer most likely set.
Why does my text look different with the same font and size?
Usually the weight, line height or letter spacing differs. Large headings often have tight line height and slightly negative letter spacing; without those the same font looks loose.
How do I copy the CSS of text from a website?
In DevTools, right-click the element in the Elements panel and choose Copy, then Copy styles. That copies every rule on the element, so you will need to trim it. A font finder extension that copies only the five type values is quicker.
What does a font size with clamp() mean?
clamp(min, preferred, max) lets the size grow with the window between two limits. The Computed tab shows only the result at your current width; the rule itself is in the Styles tab.