Critical CSS Extractor (Above-the-Fold Rules for Inlining)
Extracts the CSS rules that match the first elements of a page so you can inline them and defer the rest.
Use the tool
Why this tool exists
Inlining the CSS needed for the first screen lets the browser paint before the full stylesheet arrives.
Without a rendering engine this tool uses a proxy: html, body and the first N visible body elements. It keeps rules whose selectors match them, matching media queries, the fonts they use and the keyframes they name, and drops print rules. It gives you the style tag and the preload snippet. Check it at real viewport sizes.
How to use it
- Paste the page HTML and the full CSS.
- Set how many body elements count as above the fold.
- Copy the critical CSS into a style tag in the head.
- Load the full stylesheet with the preload snippet.
Frequently asked questions
How accurate is above the fold?
It is a heuristic by element count, not by pixels. Raise the number if content flashes unstyled.
What about selectors it cannot test?
Rules with :is(), :has() or nth-child are kept to be safe and counted in the summary.
Does it handle @media?
Yes. Inner rules are filtered and print blocks are dropped.
Is my CSS uploaded?
No.