Instagram Embed Code Generator

Paste a link to an Instagram post or reel and get a free, ready-to-paste embed code for your website — with or without the caption. No sign-up needed.
A post or Reel link from ⋯ → Copy link, e.g. https://www.instagram.com/p/… Any form works: /p/, /reel/, links with ?igsh=.Need your whole Instagram feed, not one post?

Embed the post

<div style="max-width:540px;margin:0 auto;">
<blockquote class="instagram-media" data-instgrm-permalink="https://www.instagram.com/p/DdmURC4iIv8/" data-instgrm-version="14" style="max-width:540px;min-width:326px;width:calc(100% - 2px);margin:0 auto;background:#fff;border:1px solid #dbdbdb;border-radius:3px;padding:0;">
  <a href="https://www.instagram.com/p/DdmURC4iIv8/" target="_blank" rel="noopener">View this post on Instagram</a>
</blockquote>
</div>
<script async src="https://www.instagram.com/embed.js"></script>
<p style="margin:4px auto 0;max-width:540px;text-align:center;font:11px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;color:#a3a7b0;">Created with <a href="https://elfsight.com/tools/instagram-embed-code-generator/" target="_blank" rel="noopener" style="color:inherit;text-decoration:none;">Elfsight</a></p>

Works only for posts from public accounts.

  1. Click Copy code above to copy it.
  2. Open the page’s HTML file or template.
  3. Paste the code inside <body>, where the content should appear.
  4. Save and upload the page, then open it in a browser to check.

Need your whole Instagram feed, not one post? Show it with a widget that updates by itself. See Instagram Feed →

Before you go

Need your whole Instagram feed, not one post? Show it with a widget that updates by itself.

See Instagram Feed →
Or share this free tool:
Instagram Feed widget

Show your Instagram feed, not one post

Real photos and posts from Instagram give your website a human touch. Show posts from usernames, hashtags or locations, in any combination.
  • Posts from usernames, hashtags or locations

  • A familiar Instagram look

  • Website visitors become followers

Why use this instead of the Instagram Embed button

Instagram’s own Embed button works, but you have to open the post in a browser and take the code as it is. The generator starts from the link you already have and lets you choose the kind of code.
Instagram’s Embed button
This generator
Where you start
Open the post in a web browser, click the … menu, then Embed
Paste any post or Reel link, from the app’s Share menu or the address bar
Link formats
Only the post you have open
/p/, /reel/, /reels/ and /tv/ links; igsh and other tracking parameters are removed
Check before you copy
No
Shows what it recognized: a post or a Reel, and its shortcode
Caption
Include caption checkbox
With or without the caption
Code type
Always a blockquote plus Instagram’s embed.js script
The official blockquote code, or a light iframe that loads no script
Layout
Resizes to fit the container you put it in
Wrapped in a centered, responsive container

Where you start

Instagram’s Embed button

Open the post in a web browser, click the … menu, then Embed

This generator

Paste any post or Reel link, from the app’s Share menu or the address bar

Link formats

Instagram’s Embed button

Only the post you have open

This generator

/p/, /reel/, /reels/ and /tv/ links; igsh and other tracking parameters are removed

Check before you copy

Instagram’s Embed button

No

This generator

Shows what it recognized: a post or a Reel, and its shortcode

Caption

Instagram’s Embed button

Include caption checkbox

This generator

With or without the caption

Code type

Instagram’s Embed button

Always a blockquote plus Instagram’s embed.js script

This generator

The official blockquote code, or a light iframe that loads no script

Layout

Instagram’s Embed button

Resizes to fit the container you put it in

This generator

Wrapped in a centered, responsive container

Instagram embed options reference

The official embed code is a <blockquote class="instagram-media"> that Instagram’s embed.js turns into the rendered post. These are the attributes and request options that change it.
Option
What it does
Values
Notes
data-instgrm-permalink
The link to the post or Reel that the blockquote shows
A post URL, e.g. https://www.instagram.com/p/{shortcode}/ or /reel/{shortcode}/
Only public posts render.
data-instgrm-captioned
Shows the caption under the post
Present or absent (no value)
Same as the Include caption checkbox. Remove the attribute to hide the caption.
data-instgrm-version
The version of the embed format the code was made for
A number
Keep the value Instagram generated.
embed.js
Finds the blockquotes on the page and replaces them with the rendered posts
<script async src="//www.instagram.com/embed.js"></script>
Load it once per page. If you add posts after the page loads, call instgrm.Embeds.process().
maxwidth
Sets the largest width of the embed (oEmbed API request)
320 to 658 pixels
The embed is responsive, so its height depends on the width and the caption length.
hidecaption
Returns the embed code without the caption (oEmbed API request)
true, false
Default is false.
omitscript
Returns the embed code without the embed.js script tag (oEmbed API request)
true, false
Use it when you load embed.js once yourself.

data-instgrm-permalink

What it does

The link to the post or Reel that the blockquote shows

Values

A post URL, e.g. https://www.instagram.com/p/{shortcode}/ or /reel/{shortcode}/

Notes

Only public posts render.

data-instgrm-captioned

What it does

Shows the caption under the post

Values

Present or absent (no value)

Notes

Same as the Include caption checkbox. Remove the attribute to hide the caption.

data-instgrm-version

What it does

The version of the embed format the code was made for

Values

A number

Notes

Keep the value Instagram generated.

embed.js

What it does

Finds the blockquotes on the page and replaces them with the rendered posts

Values

<script async src="//www.instagram.com/embed.js"></script>

Notes

Load it once per page. If you add posts after the page loads, call instgrm.Embeds.process().

maxwidth

What it does

Sets the largest width of the embed (oEmbed API request)

Values

320 to 658 pixels

Notes

The embed is responsive, so its height depends on the width and the caption length.

hidecaption

What it does

Returns the embed code without the caption (oEmbed API request)

Values

true, false

Notes

Default is false.

omitscript

What it does

Returns the embed code without the embed.js script tag (oEmbed API request)

Values

true, false

Notes

Use it when you load embed.js once yourself.

Instagram docs ↗

Why the Instagram post doesn’t show

The account is private

Posts from private accounts can’t be embedded. The owner has to make the account public, or pick a post from a public account.

The owner turned off embeds

Accounts that disabled Embeds aren’t supported. The owner can turn embeds back on in their Instagram settings.

The account is age-restricted or inactive

Instagram doesn’t render posts from these accounts. Choose a post from another account.

It’s a Story

Stories can’t be embedded. Share the content as a post or a Reel and embed that link.

You see a plain box with a link instead of the post

embed.js didn’t run. Keep the script tag in the code, and if posts are added after the page loads, call instgrm.Embeds.process(). Or use the iframe version, which needs no script.

The code sits inside a Shadow DOM

Instagram doesn’t support Shadow DOM. Place the code in the regular page HTML.

Reels, posts and Stories: what can be embedded

Content
Can it be embedded?
Link to paste
Notes
Post (photo, carousel, video)
Yes, from public accounts
instagram.com/p/{shortcode}/
Caption can be shown or hidden.
Reel
Yes, from public accounts
instagram.com/reel/{shortcode}/
Caption can be shown or hidden.
Story
No
—
Instagram doesn’t support embedding Stories.

Post (photo, carousel, video)

Can it be embedded?

Yes, from public accounts

Link to paste

instagram.com/p/{shortcode}/

Notes

Caption can be shown or hidden.

Reel

Can it be embedded?

Yes, from public accounts

Link to paste

instagram.com/reel/{shortcode}/

Notes

Caption can be shown or hidden.

Story

Can it be embedded?

No

Link to paste

—

Notes

Instagram doesn’t support embedding Stories.

How to embed an Instagram post

  1. Copy the post link

    Open the post or reel on Instagram and copy its link.

  2. Paste it here

    Paste the link above and choose whether to show the caption.

  3. Copy the code

    Copy the embed code and paste it into an HTML or code block on your site.

Frequently asked questions

More Embed Code Generators

iFrame Generator

Build a responsive iframe for any page, form or app.iFrame Generator