If you need the exact Google Drive embed URL format for iframe, use this:
https://drive.google.com/file/d/FILE_ID/previewThe normal sharing URL (.../view?usp=sharing) is not the iframe URL.
This guide shows the exact format, copy-paste iframe examples, and common fixes when embed does not work.
1. Open sharing on the file
Right-click the file in Drive and choose Share (or Share from the submenu if it appears).

2. Set “Anyone with the link” + Viewer, then copy link
In the sharing dialog, set General access to Anyone with the link and keep the role Viewer.
If that looks right, click Copy link.

The URL usually looks like this:
The segment like 10N111TfBknfp_dIsVGqegf-SINLpzDKC is the file ID.
https://drive.google.com/file/d/10N111TfBknfp_dIsVGqegf-SINLpzDKC/view?usp=sharing3. Correct Google Drive preview URL format for embed
The /view link is for opening the file in the browser.
Dropping it straight into an <iframe src> usually won’t embed.
For embedding, use the /preview URL.
https://drive.google.com/file/d/FILE_ID/previewOption A: Build the iframe yourself
Replace the view?usp=... part with:
<iframe
src="https://drive.google.com/file/d/FILE_ID/preview"
width="640"
height="480"
></iframe>FILE_IDis the same ID from.../file/d/FILE_ID/view....- Adjust
width/heightfor your layout (CSSmax-width: 100%helps on small screens).
In Astro Markdown / MDX you can use raw HTML or wrap it in a component, depending on your setup.
Option B: Use Drive’s “Embed item” HTML
Open the file in the browser
Paste the view URL into the address bar — you’ll get Drive’s preview UI.
Get embed HTML from the menu
Use File → Share → Embed item (wording may vary slightly by account language).

Copy the iframe HTML
The dialog shows a ready-made iframe — copy it into your site.

Example
<iframe
src="https://drive.google.com/file/d/FILE_ID/preview"
width="640"
height="480"
></iframe>What it looks like embedded
Common embed issues
Why does iframe open the Drive page instead of embedded preview?
You are probably using the .../view?... URL.
Switch to .../preview in iframe src.
Why is the iframe blank or permission denied?
Check file sharing first: Anyone with the link + Viewer.
Does this work for video and PDF?
Yes. The same /file/d/FILE_ID/preview format works for common Drive file types.
Summary
- Anyone with the link / Viewer (or your equivalent), then copy the link.
- For embedding use
https://drive.google.com/file/d/FILE_ID/previewasiframesrc. - Either hand-build the iframe or use File → Share → Embed item to copy HTML.
That’s it.