Free YouTube Embed Code Generator
Paste a YouTube link, set the start time and size, and copy a privacy-enhanced iframe for your site.
Loading the editor…
How to use this tool
Putting a YouTube video on a web page takes an iframe snippet with the right video ID, size and options. This generator reads a watch, youtu.be, Shorts or live link, adds your start time in seconds and your width and height, and returns ready-to-paste HTML. The player loads from youtube-nocookie.com, YouTube’s privacy-enhanced embed domain.
- 01
Paste the video link
Copy the video’s address from YouTube and paste it into YouTube address. Watch pages, youtu.be links, Shorts, live and embed URLs all work.
- 02
Set start time and size
Enter Start (seconds), such as 90 for 1:30, or 0 to play from the beginning. Set Width (px) and Height (px) between 100 and 4096; 800 × 450 keeps a 16:9 shape.
- 03
Create result and paste
Click Create result, then Copy the code or use Download HTML. Paste it into an HTML or custom code block on your site and preview the page.
What the generated embed code includes
• width and height in pixels, as you entered them • A src on youtube-nocookie.com with your video ID and start time • loading=lazy, so the player loads as it scrolls into view • allowfullscreen and YouTube’s standard permissions, such as picture-in-picture • A strict-origin-when-cross-origin referrer policy The code is a single iframe with no script, so it works in most site builders that accept HTML. In privacy-enhanced mode, YouTube says views of the embedded video aren’t used to personalize the viewer’s YouTube experience or ads.
Convert a timestamp to seconds
The start field takes whole seconds. Multiply minutes by 60 and hours by 3,600, then add the rest: • 0:45 → 45 • 1:30 → 90 • 2:05 → 125 • 10:00 → 600 • 1:02:03 → 3723 Decimals are rounded down, and the start can be up to 604,800 seconds (7 days).
Choosing a player size
For standard 16:9 videos, keep width and height in that ratio: • 560 × 315 for narrow columns • 640 × 360 for blog posts • 800 × 450 for wide content areas • 1280 × 720 for full-width layouts YouTube asks for an embedded player of at least 200 × 200 pixels and recommends at least 480 × 270 for 16:9. For vertical Shorts, swap the numbers, for example 315 × 560.
Make the embed responsive
The generated iframe has a fixed size. To let it shrink on phones, add a style attribute to the iframe with width:100%; height:auto; aspect-ratio:16/9; or place it in a video block your site builder already makes responsive. Preview the page at phone width after pasting.
Frequently asked questions
What is a YouTube embed code?
A YouTube embed code is a short piece of HTML, an iframe, that shows a YouTube player inside your own web page. Visitors watch on your site while YouTube hosts and streams the video. This generator builds that iframe from a normal video link.
How do I embed a YouTube video on my website?
1. Paste the video link into YouTube address. 2. Enter a start time in seconds and the player width and height. 3. Click Create result and copy the code. 4. In your site editor, add an HTML or embed block, paste the code and publish.
How do I make an embedded YouTube video start at a specific time?
Enter the start point in whole seconds in Start (seconds), such as 75 for 1:15. The generator adds start=75 to the embed URL, and the player begins there when a visitor presses play. Playback can begin a moment early because YouTube starts from the nearest keyframe.
What is youtube-nocookie.com?
It’s the domain for YouTube’s Privacy Enhanced Mode. According to YouTube, a view in this mode isn’t used to personalize the viewer’s YouTube browsing or the ads they see elsewhere. The generator uses it for every embed, so you don’t need to change the domain yourself.
Which YouTube links work?
Watch pages, youtu.be short links, Shorts, live and embed URLs work, including links from m.youtube.com and music.youtube.com. A playlist link works only if it contains a video ID, and then just that one video is embedded. Channel pages can’t be embedded.
Can I add autoplay, loop or hide the controls?
The generator doesn’t have switches for those. You can add YouTube player parameters to the end of the src yourself, such as &autoplay=1&mute=1 for muted autoplay or &controls=0 to hide the controls. Most browsers block autoplay with sound, and YouTube notes that autoplayed embeds don’t add to the view count.
Why doesn’t my embedded video play?
The owner may have turned off embedding, or the video is private, removed or blocked in the visitor’s country. Age-restricted videos send viewers back to YouTube instead of playing on your page. Some site builders also strip iframes from regular text blocks, so paste the code into an HTML or custom code block.
Can I embed YouTube Shorts?
Yes. Paste the Shorts link, and the generator turns it into a standard embed with the same video ID. Shorts are vertical, so set a tall size such as 315 × 560 to avoid wide black bars.
Is anything sent to SocQ when I generate the code?
No. The video ID is read from your link and the code is built in your browser, without contacting YouTube or SocQ. Visitors’ browsers connect to YouTube only once the embed is live on your page.
Is the YouTube embed code generator free?
Yes. It’s free with no signup or account, and the code has no SocQ branding or tracking added. Generate as many embeds as you need for any public YouTube video that allows embedding.
For developers
Get public YouTube video and channel data
SocQ APIs return public YouTube video and channel data, such as titles, descriptions and public view counts, so you can list or refresh the videos you embed. Watch time and other YouTube Studio analytics stay private to the channel owner.
Keep working with free tools
View all tools- FREEInstagram
Free Instagram Font Generator
Compare eight copy-and-paste text styles for an Instagram name, bio line or caption.
- FREELinkedIn
Free LinkedIn Text Formatter
Highlight key phrases and organize LinkedIn posts with bold, italic and bullet-list formatting.
- FREEInstagram
Free Instagram Line Break Generator
Prepare Instagram caption paragraphs and blank-line spacing, then copy the complete text.
- FREEX / Twitter
Free Twitter (X) Character Counter
Check X post length with weighted link and emoji counts and a live remaining-space display.



