X (Twitter) Embed Generator

Paste a link to a post on X (Twitter) and get a free embed code that shows it on your website with the original styling — no sign-up needed.
The post’s link from Share → Copy link, e.g. https://x.com/username/status/1234567890 (twitter.com works too)Want a feed of your posts instead of one?

Embed the post

<blockquote class="twitter-tweet" data-align="center">
  <a href="https://twitter.com/jack/status/20">View this post on X</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p style="margin:4px auto 0;max-width:550px;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/twitter-embed-generator/" target="_blank" rel="noopener" style="color:inherit;text-decoration:none;">Elfsight</a></p>

  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.

Want a live feed of your posts instead of one? Use a feed widget that stays up to date. See Twitter Feed →

Before you go

Want a live feed of your posts instead of one? Use a feed widget that stays up to date.

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

Show your X feed, not one post

Real-time posts make your website feel active and current. Display your profile with a custom header, or filter posts by hashtag for a campaign.
  • Your profile, or posts filtered by hashtag

  • A custom header for your feed

  • Grow your audience on X

Why use this instead of the X Embed button

X’s Embed post menu sends you to publish.x.com for the code. The generator starts from the link you already have and puts every documented option in one form.
X’s Embed button
This generator
Where you start
Open the post, choose Embed post in its menu, then copy the code on publish.x.com
Paste the post link
Link formats
Only the post you have open
x.com and twitter.com links; ?s= and other parameters are removed
Options
Customize on publish.x.com or edit the data- attributes in the code
Theme, parent post, media, width, alignment, language and do-not-track in one form
Width
Set in the code
Kept within X’s supported range of 250–550 pixels
Personalization
Add data-dnt yourself
One checkbox adds data-dnt="true"

Where you start

X’s Embed button

Open the post, choose Embed post in its menu, then copy the code on publish.x.com

This generator

Paste the post link

Link formats

X’s Embed button

Only the post you have open

This generator

x.com and twitter.com links; ?s= and other parameters are removed

Options

X’s Embed button

Customize on publish.x.com or edit the data- attributes in the code

This generator

Theme, parent post, media, width, alignment, language and do-not-track in one form

Width

X’s Embed button

Set in the code

This generator

Kept within X’s supported range of 250–550 pixels

Personalization

X’s Embed button

Add data-dnt yourself

This generator

One checkbox adds data-dnt="true"

X embed options reference

An embedded post is a <blockquote class="twitter-tweet"> plus X’s widgets.js, which turns it into the full post. These attributes go on the blockquote.
Option
What it does
Values
Notes
data-theme
Color theme of the post
light, dark
Light is the default. dark shows light text on a dark background.
data-conversation
Hides the parent post when the post is a reply
none
By default a reply shows a compact version of the post it answers.
data-cards
Hides photos, videos and link previews
hidden
Links stay in the text but aren’t expanded.
data-width
Largest width of the post
250 to 550 pixels
Whole pixels only.
data-align
Floats the post relative to its container
left, right, center
Left is the default. X recommends this option over CSS for centering.
data-lang
Language of X’s interface text, such as buttons and dates
A supported language code, e.g. es, fr, de
The post’s own text stays in the language it was written in.
data-dnt
Do not track: the post and your page aren’t used for personalized suggestions and ads
true
For the whole site, use <meta name="twitter:dnt" content="on">.

data-theme

What it does

Color theme of the post

Values

light, dark

Notes

Light is the default. dark shows light text on a dark background.

data-conversation

What it does

Hides the parent post when the post is a reply

Values

none

Notes

By default a reply shows a compact version of the post it answers.

data-cards

What it does

Hides photos, videos and link previews

Values

hidden

Notes

Links stay in the text but aren’t expanded.

data-width

What it does

Largest width of the post

Values

250 to 550 pixels

Notes

Whole pixels only.

data-align

What it does

Floats the post relative to its container

Values

left, right, center

Notes

Left is the default. X recommends this option over CSS for centering.

data-lang

What it does

Language of X’s interface text, such as buttons and dates

Values

A supported language code, e.g. es, fr, de

Notes

The post’s own text stays in the language it was written in.

data-dnt

What it does

Do not track: the post and your page aren’t used for personalized suggestions and ads

Values

true

Notes

For the whole site, use <meta name="twitter:dnt" content="on">.

X docs ↗

Why the X post doesn’t show

The post shows as plain text with a link

X’s widgets.js didn’t load, so the blockquote was never turned into a post. Keep the <script> tag in the code, make sure your site builder doesn’t strip scripts from that block, and check that a browser extension isn’t blocking it.

The post was added after the page loaded

widgets.js scans the page once. Call twttr.widgets.load() after you insert new posts.

The account’s posts are protected

Embed code isn’t available for protected posts. Only public posts can be embedded.

The post was deleted, made protected, or the account was suspended

The text of the post stays on your page, but X no longer loads its media. Replace it with another post.

The visitor uses a very old browser

X widgets don’t render in Internet Explorer 11 and older. Visitors see the plain-text version.

How to embed a post from X (Twitter)

  1. Copy the post link

    On X, open the post, choose Share → Copy link.

  2. Paste it and pick options

    Paste the link and choose the theme and what to show.

  3. Add the code to your site

    Copy the code and paste it into an HTML block where the post should appear.

Frequently asked questions

More Embed Code Generators

iFrame Generator

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