Feedback

YouTube: impact on page speed

Category: Video embed

An embedded YouTube video loads the complete player with its JavaScript as soon as the iframe is rendered, even if nobody presses play. That makes it one of the most expensive embeds per page.

On 4.4 % of the 5509 homepages measured, YouTube is among the five heaviest third parties. Where it is, it takes a median of 586 ms of main-thread time; on the heaviest quarter of those sites it takes 1,097 ms or more.

4.4 %

of homepages: among the five heaviest third parties

586 ms

median main-thread time

1,097 ms

main-thread time on the heaviest quarter (p75)

991 KB

median transfer size

Distribution across homepages

Percentiles across 240 homepages with YouTube.

Percentile Main-thread time Transfer size
p25
13 ms
204 KB
Median
586 ms
991 KB
p75
1,097 ms
1.9 MB
p90
1,789 ms
3.4 MB

In context

YouTube has the highest median main-thread time of the 72 third parties in the benchmark, followed by Google Tag Manager.

On 74 % of the homepages where it appears, YouTube alone uses 250 milliseconds of main-thread time or more, the mark from which Lighthouse flags third-party code.

Homepages with YouTube weigh 6.9 MB at the median (JavaScript: 2.4 MB), homepages without it 4.2 MB (JavaScript: 1.5 MB).

Often loaded together with

Share of homepages with YouTube where the other tool is also among the five heaviest third parties.

How to spot YouTube on your page

An embed requests the player page from youtube.com or youtube-nocookie.com, then the player's base.js and styles and a series of logging requests to the same domain. The cost is paid per embed, so a page with three videos pays it three times. A facade turns this into a single image request until someone actually wants to watch.

How to reduce the impact of YouTube

Frequently asked questions

How can I load YouTube with less impact?

Use a facade: show a thumbnail with a play button and load the player only on click (for example with lite-youtube-embed). Add loading="lazy" to iframes below the fold.

Does YouTube affect Core Web Vitals?

A YouTube embed mostly affects LCP and, through its player scripts, INP. The standard iframe loads the player as soon as the page opens, even if nobody presses play, and when the video sits at the top of the page its preview image can become the largest element. An iframe without fixed dimensions also shifts the layout while it loads.

Method and sample: Third-Party Benchmark.

Run a free test All third parties in the benchmark