YouTube Embed Code Generator
Paste a YouTube URL to create embed code (an iframe) for your blog or website. Set the start and end time, autoplay, loop, captions and responsive sizing while checking a live preview, and create share links that start at a specific time.
Paste a video page URL, a share link (youtu.be), a Shorts, live or playlist URL, an 11-character video ID, or even embed code (iframe) you already use.
Create a share link that starts playing at a specific moment — handy when you want to say "watch from here" on social media, by email or in a chat.
Enter 1:23, 0:01:23, 83 (seconds) or 1m23s. Leave blank for a link without a timestamp.
Shorts URLs (/shorts/) may ignore timestamps, so the links above use the standard watch?v= format. The URL below also opens the Short in the regular player, where you can seek and change the playback speed.
Tips for timestamp links
- youtu.be links take the time in seconds (?t=83), while standard links can use minutes and seconds (&t=1m23s). Both start at the same point.
- A time later than the length of the video may not play correctly.
- To show the video itself on your blog, use the start time on the "Embed code" tab instead.
How to Use
Paste the video URL
Open the video on YouTube, copy the URL from the address bar or the Share button, and paste it into the input box. Shorts, live and playlist URLs, or a plain 11-character video ID, work too.
Choose playback and size options
Set the start and end time, autoplay, loop, captions and sizing (responsive or fixed). Every change shows up in the code and preview right away. If you are unsure, the defaults work fine.
Copy and paste the code
Click "Copy code" and paste it into the HTML of your blog or website. In WordPress, use a "Custom HTML" block. For a share link that starts at a certain time, use the "Timestamp link" tab.
About the YouTube Embed Code Generator
This tool creates the HTML (an iframe tag) that shows a YouTube video on your own blog or website. Beyond what YouTube's Share → Embed dialog offers, you can set an end time, loop, captions and the player language, disable keyboard controls, and use responsive sizing that never overflows on phones — just by ticking boxes. The iframe attributes match YouTube's official embed code, so you can use the result with confidence. Everything runs in your browser, and the URLs you enter are never sent to our server.
To watch one section over and over, try the YouTube Repeat Player. To share a timestamp link on a flyer or slide, turn it into a QR code with the QR Code Generator. Create chapters (timestamps) for your video description with the YouTube Chapter Maker. Check how your custom thumbnail looks with the YouTube Thumbnail Preview.
Features
- More options than the official embedBesides the start time, set an end time, loop, captions and the player language, or hide the full-screen button and disable keyboard controls — options YouTube's Embed dialog doesn't offer.
- Responsive code that fits any screenChoose a simple CSS aspect-ratio version or the classic div-wrapper version. Vertical 9:16 Shorts and a maximum width are supported too.
- Live preview with the real playerThe preview updates shortly after each change, so you can check the start position and size on the spot.
- Timestamp share linksCreate "start at 1:23" links in both the short youtu.be format and the standard format. Tracking parameters such as si= are removed automatically.
- Rebuild your existing embed codePaste the embed code you already use and the tool reads its settings, such as the start time and autoplay, so you can rebuild it as responsive code.
- Runs entirely in your browserAll code is generated in your browser. The URLs and settings you enter are never sent to our server.
Use Cases
- Add a tutorial or product video to a blog post or announcement
- Embed just the part of a long video you want people to see, with start and end times
- Play a muted, looping mood video in the hero of a store site or landing page
- Put videos on mobile-first pages without anything overflowing the screen
- Send a "watch from 1:23" link on social media, by email or in a chat
Common YouTube embed parameters
Parameters go after the "?" in the embed URL as name=value pairs joined with "&". This tool writes them correctly when you tick the options.
| Parameter | What it does |
|---|---|
start=83 | Starts playback at 83 seconds (1:23). |
end=165 | Stops playback 165 seconds (2:45) from the beginning of the video. |
autoplay=1 | Autoplays the video. In most browsers this only works together with mute=1. |
mute=1 | Starts playback muted. |
loop=1& | Loops playback. For a single video, pass the same video ID in playlist. |
controls=0 | Hides the player controls, such as the play button and seek bar. |
cc_load_policy=1 | Shows captions by default. |
cc_lang_pref=ja | Sets the preferred caption language (an ISO 639-1 code, for example). |
hl=en | Sets the language of the player's buttons and menus. |
fs=0 | Hides the full-screen button. |
disablekb=1 | Disables the player's keyboard controls. |
playsinline=1 | Plays inline on iPhone instead of switching to full screen. |
rel=0 | Limits related videos to the same channel (it can't hide them). |
videoseries? | Embeds a playlist. |
modestbranding=1 / | Retired by YouTube and no longer have any effect (modestbranding since 2023, showinfo since 2018). |
FAQ
I turned on autoplay, but the video doesn't start by itself. Why?
How do I make a video loop?
Can rel=0 hide related videos?
What is privacy-enhanced mode (youtube-nocookie.com)?
How do I add the code to WordPress?
The video overflows or looks broken on phones. What should I do?
How do I set the start and end times?
The embedded video doesn't show up or shows an error. What should I check?
Can I embed Shorts or playlists?
Updates to this tool
-
New
New video tools: YouTube Chapter Maker, YouTube Thumbnail Preview, YouTube Embed Code Generator, Video Frame Extractor, Video to GIF Converter.
Feedback
Missing a feature, or getting a result that looks wrong? Let us know — we improve our tools based on your feedback.