Skip to tool
Critical rendering path optimization

Critical CSS Generator

Extract the exact styles needed above the fold across multiple viewports, then ship a faster first render with less blocking CSS.

  • Multi-viewport analysis
  • Advanced selector control
  • CSS + HTML output
Generate critical CSS
Enter a page URL, then fine-tune viewports and extraction rules if needed.
Advanced configurationCustomize viewports and extraction rulesOptional

Viewport coverage

Select the screen sizes used for above-the-fold extraction.

Excluded rule types

Leave non-critical declarations out of the generated stylesheet.

Custom viewport

Add another screen size to the extraction pass.

Viewport dimensionsDimensions are measured in CSS pixels.

Always include selectors

Preserve important selectors even when they are outside the detected critical path.

Press Enter, comma, or space after each selector.

Prioritize the first render

Generate above-the-fold CSS for every important viewport

Extract the rules needed for the initial screen while preserving control over responsive layouts, selectors, fonts, and backgrounds.
01

What the Critical CSS Generator analyzes

Critical CSS is the smallest practical subset of styles required to render content in the initial viewport. The generator loads the requested page, evaluates the elements visible above the fold, and collects the CSS rules those elements depend on. The output can be copied or downloaded as CSS together with the corresponding HTML.

Mobile, tablet, and desktop pages rarely expose exactly the same content. Responsive navigation, grid breakpoints, typography, and hero media can all change which rules are critical. Select multiple screen sizes in one extraction pass or add custom viewport dimensions that match the devices most important to your audience.

02

Control selectors and excluded rule types

Some important states are not visible during an automated page load. A menu may require interaction, a consent banner may depend on geography, or a personalization class may be added later. Use the force-include option to retain selectors that must ship with the initial document even when they are not detected in the sampled state.

You can also exclude @font-face blocks, @keyframes, or background image declarations to keep the inline payload focused. Treat these settings as implementation controls, not automatic recommendations. A hero background or a font used by the LCP heading may still be essential to the first render.

Critical rendering path

Reduce render-blocking CSS without leaving the page unstyled

Inline the extracted rules early, retain the complete stylesheet, and test the handoff between critical and deferred styles.
01

How critical CSS changes the first render

A normal external stylesheet is render-blocking because the browser needs CSS before it can safely paint the page. When a large stylesheet includes rules for footers, modals, account screens, and components far below the fold, the initial render can wait for far more CSS than it needs. Inlining a compact critical stylesheet in the document head gives the browser the styles required to paint visible content sooner.

This optimization can reduce the render delay portion of Largest Contentful Paint and improve perceived loading speed. It is most useful when CSS transfer, parsing, or discovery is a meaningful bottleneck in the page's critical rendering path.

02

Keep the full stylesheet as the source of truth

Critical CSS does not replace the main stylesheet. The browser still needs the complete CSS for content below the fold, interactive states, later navigation, and responsive changes. Load the full stylesheet after the critical rules using a method supported by your framework, CMS, or performance plugin, and include a reliable fallback.

Avoid hiding the page until deferred CSS arrives. That can exchange render-blocking CSS for a flash of invisible content or delayed LCP. Test with JavaScript disabled, slow network conditions, cached visits, and each breakpoint included in the extraction.

Implementation and validation

Use critical CSS safely in a production workflow

Measure the real bottleneck, keep generated output current, and verify visual accuracy before shipping.
01

Validate Core Web Vitals and visual output

Compare a baseline test with the optimized page instead of assuming a smaller blocking stylesheet will improve every metric. Use the LCP Finder to identify the largest element and its timing breakdown, then confirm whether render delay fell after the critical CSS change. Also watch Cumulative Layout Shift because a missing rule, late font, or unstyled placeholder can move content when the full stylesheet arrives.

Inspect the page on mobile, tablet, and desktop for flashes of unstyled content, incorrect font metrics, missing backgrounds, broken menus, and style changes during hydration. The fastest stylesheet is not useful if it makes the initial view unstable or incomplete.

02

Regenerate output when templates change

Generated critical CSS belongs to a specific page state and set of viewport dimensions. Rebuild it when you change a hero, header, font, breakpoint, theme, consent layer, or reusable component that appears near the top of the page. Ecommerce and CMS sites may need one output per major template rather than one stylesheet for the entire domain.

Keep the generated file under the same review and deployment process as application code. Monitor its inline size, remove obsolete rules, and rerun page speed tests after releases so stale output does not silently expand or diverge from the rendered page.

Frequently Asked Questions