In this guide
An embedded player belongs inside a web page, while a watch link opens the video on YouTube. The generator provides both artifacts so a page can include playback and retain a direct route to the source. Its preview loads only when requested; generating the code does not require playing the video.
Generate a YouTube embed
Files and text are processed in this browser.
Loading the player connects to YouTube. Playback depends on the video owner and YouTube’s restrictions.
Start and end identify positions in the source
An excerpt beginning at 90 seconds and ending at 150 seconds spans one minute. The end value is 150, not 60: both parameters refer to the source timeline. A value such as 1:30 is a human-readable duration; the embed URL carries its equivalent number of seconds.
The watch link retains the start position. The iframe’s end setting belongs to the embedded player, so the two outputs are useful in different places. YouTube may seek to a nearby keyframe when starting playback; an embed parameter is not a frame-accurate video edit.
An excerpt from 90 to 150 seconds lasts one minute, but its end value is 150: both parameters count from the start of the video.
A responsive player still needs usable controls
YouTube requires a player viewport of at least 200 × 200 pixels and recommends at least 480 × 270 for 16:9 players. A responsive width alone is insufficient on a narrow page: a 320-pixel-wide 16:9 box would be only 180 pixels tall. The generated layout keeps the minimum height while allowing the player to follow its container width.
- YouTube’s player parameter reference
Current timing, controls, related-video settings and viewport requirements.
What privacy-enhanced mode and rel actually change
Privacy-enhanced mode uses youtube-nocookie.com. YouTube describes it as limiting how embedded views influence personalization; loading the player still contacts YouTube. Separately, rel=0 limits related videos to the same channel after playback. It does not remove recommendations. These options control different aspects of the player and should not be described as interchangeable.
- Official embed instructions and privacy-enhanced example
YouTube’s published iframe examples, domain choice and sharing instructions.
When the code is valid but playback fails
YouTube’s error reference separates an unavailable or private video (100), embedding disabled by the owner (101 or 150), and missing HTTP Referer or equivalent client identification (153). Changing the aspect ratio does not resolve those conditions. A host that strips the referrer can affect an otherwise valid embed; the direct watch link remains a useful route to the original video.
- YouTube iframe error codes
Primary definitions for unavailable videos, embedding permissions and client identification.
Common questions
Is end a duration after the start?
No. It is a position measured from the video’s beginning. For a minute from 1:30, use start 90 and end 150.
Does rel=0 hide all related videos?
It limits related videos to the same channel. YouTube no longer provides the old interpretation of disabling them with that parameter.
Can I paste the HTML into a video description?
The iframe is for a web page that accepts embed HTML. Use the watch link in places that accept ordinary URLs.
Sources and method
Parameters, viewport dimensions and error meanings follow YouTube’s player documentation. Privacy-enhanced mode follows YouTube Help.
Sources checked on .
- YouTube: Embedded players and parametersdevelopers.google.com
- YouTube Help: Embed videos and playlistssupport.google.com
- YouTube: Iframe player errorsdevelopers.google.com
