Free tool

Facebook Embed Code Generator

Paste a link to a public Facebook post or video and get the code to put it on your website. Free, no sign-up.

Your embed code

Your embed code shows here.

This is a page or profile link. An embed code shows one post. To show the latest photos from your Facebook page on your website, create a free widget.

Create a free widget

This is a link to a group. Facebook lets you embed public posts from Pages and profiles only.

This is a share link. Open it in your browser, then copy the post's address from the address bar and paste it here.

Paste a link to a Facebook post or video first.

This is not a Facebook post or video link. Example: https://www.facebook.com/yourpage/posts/1234567890

Paste the code where your website builder accepts HTML. The post shows at 500 px wide, and on phones it fits the screen. Your browser did not let us copy. Tap and hold in the code box, choose Select All, then Copy. Your browser did not let us copy. Click in the code box, then press Ctrl+A and Ctrl+C (Cmd+A and Cmd+C on a Mac).

Paste a link to see the post here. A long post scrolls inside the frame. If the preview stays empty, the post is not public or it was deleted. Your browser blocked Facebook's script, for example with an ad or tracker blocker, so the preview cannot load. The code itself is fine.

Want your page's latest photos, updated automatically?

An embed code shows one post. A free SnapWidget widget shows the latest photos from your Facebook page, or one album, and adds new ones by itself.

Create a free widget

How do I embed a Facebook post on my website?

Copy the post's link, paste it into the tool above and copy the embed code. Then paste the code into an HTML or code block on your website and publish the page.

  1. On Facebook, open the public post or video and copy its address from the address bar.
  2. Paste the link above, choose whether to include the post text, and click Get embed code.
  3. Click Copy code and paste it into your website where it accepts HTML.

Which Facebook posts can I embed?

Public posts from Facebook Pages and profiles, including public videos and photos. A post that only friends or the members of a group can see does not show on your website.

Why does the code have a script and an fb-root line?

Facebook's SDK script turns the fb-post or fb-video line into the post. If you embed several posts on one page, paste the fb-root and script lines once, and then only the fb-post or fb-video line for each other post.

How do I change the size of the embedded post?

Change data-width in the code to a number from 350 to 750. If you remove data-width, the post fills the width of its column. Facebook asks you not to size the post with CSS.

Why does my embedded Facebook post not show?

The post is not public, or it was deleted. An ad or tracker blocker can also stop Facebook's script.

What is the difference between an embed code and a Facebook widget?

An embed code shows one post that you choose. A free SnapWidget Facebook widget shows the latest photos from your page, or one album, and adds new ones by itself. The Facebook feed widget on paid plans shows your page's text posts, photos and videos.

Does the embed code work on WordPress, Squarespace and Shopify?

Yes, in any place that accepts HTML with a script. Paste it where our guides paste the SnapWidget code: a Custom HTML block in WordPress, a Code Snippet in a Squarespace Embed block, or a Custom Liquid section in Shopify.

Frequently asked questions

Yes. It is free and needs no sign-up or Facebook login. Your browser builds the code, and the preview loads the post from Facebook.

Yes. Paste the link of a public video or reel, for example https://www.facebook.com/yourpage/videos/1234567890 or https://www.facebook.com/reel/1234567890. The tool makes the code for Facebook's embedded video player.

No. Facebook embeds only work for public posts from Pages and profiles. Make the post public first.

Yes. Paste the fb-root and script lines once, then one fb-post or fb-video line for each post.

An embed code shows one post. A free SnapWidget Facebook widget shows the latest photos from your page and adds new ones by itself. The feed layout, with text posts and videos, is on paid plans from $8 a month.

Show your Facebook page on your website, not one post