Skip to content
AgileLogics

Twitter Card Generator

Generates Twitter/X Card meta tags that control how a page previews when shared on Twitter/X.

How it works

Enter a title, fill in the optional fields, and click Generate.

How do X (Twitter) Cards work?

When someone posts a link on X, X's crawler reads the page's <meta name="twitter:…"> tags to build a preview card. The twitter:card tag picks the layout; the title, description and image tags fill it in. This generator produces those tags for the two layouts most sites use, summary and summary_large_image, from a title and four optional fields.

The two card types

summary summary_large_image (default here)
Layout Small square thumbnail beside the text Wide image above the text
Aspect ratio 1:1, cropped to a square 2:1
Minimum size 144 × 144 px 300 × 157 px
Maximum size 4096 × 4096 px 4096 × 4096 px
File size Under 5 MB Under 5 MB

The figures come from X's summary card and summary card with large image pages. X has since moved its developer documentation to docs.x.com, which doesn't currently carry the card reference, and the old addresses redirect to its home page, so those links point to archived copies. Pick the large card for articles and product pages with a strong image; the small card suits pages where the only image is a logo or icon.

Example output

With the title Trail Running Shoes for Wet Rock, a one-line description, an image URL, the handle @exampleoutdoors and the default card type:

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Trail Running Shoes for Wet Rock">
<meta name="twitter:description" content="We tested 9 shoes on wet granite.">
<meta name="twitter:image" content="https://example.com/img/wet-rock.jpg">
<meta name="twitter:site" content="@exampleoutdoors">

The card and title lines are always present. Description, image and site appear only when filled, in that order. Fields are trimmed at both ends, and &, <, > and " are escaped as &amp;, &lt;, &gt; and &quot;, so text like Tips & Tricks can't break the attribute. The handle is copied as typed: entering exampleoutdoors without the @ produces content="exampleoutdoors", which isn't the documented format.

Adding cards to a page

  1. Type the title and fill in the description, image URL and @site handle.
  2. Choose summary or summary_large_image.
  3. Click Generate and paste the tags into the page's <head>. Use only one twitter:card per page; X's getting started guide says that if there are several, the last one takes priority.
  4. Make sure the image URL is absolute, publicly reachable and meets the size rules above. The image size analyzer reports an image's pixel dimensions from its URL.
  5. Publish, then post the link (or preview it in a draft) to see the card.

Lengths and extra tags

The generator doesn't measure anything. X's markup reference gives these limits:

  • twitter:title: maximum 70 characters.
  • twitter:description: maximum 200 characters.
  • twitter:image:alt: maximum 420 characters. The tool has no field for it, so add it by hand; it's the text screen-reader users hear for the card image, and it falls back to og:image:alt.

Two other tags you might add manually are twitter:creator, the @username of the article's author, and twitter:site:id or twitter:creator:id if you'd rather reference numeric account IDs than handles.

The same reference also explains fallback: if twitter:card is absent but og:type, og:title and og:description exist, X may render a summary card anyway. So a page that already has full Open Graph markup from the Open Graph generator only needs a twitter:card line to get the large layout.

Common reasons a card doesn't appear

  • The image is an SVG, over 5 MB, or below the minimum size for the chosen card.
  • The image URL is relative, behind a login, or returns an error.
  • The page's <head> holds a second, conflicting twitter:card tag from a plugin.
  • robots.txt blocks the page or the image. X's crawler identifies as Twitterbot and follows Google's robots.txt rules; a blocked page shows no card and a blocked image shows no picture.
  • The link was shared before you fixed the tags. The same getting started guide says X caches card content for 7 days after a link to the page is posted.

For the other half of social sharing, the share link generator builds a pre-filled X post link for a page, and the meta tag generator covers the search-facing title and description.

Last updated

Frequently asked questions

Do I need Twitter tags if my page already has Open Graph tags?
Only one of them. X checks for its own tag first and falls back to og:title, og:description and og:image when the twitter-prefixed version is missing. Add a twitter:card tag to choose the layout; the rest can come from Open Graph.
What's the difference between summary and summary_large_image?
Summary shows a small square thumbnail beside the title, cropped to 1:1, with a 144 by 144 pixel minimum. Summary_large_image shows a wide 2:1 image above the title, with a 300 by 157 pixel minimum. Both accept images up to 4096 by 4096 pixels and under 5 MB.
Should I include the @ in the site handle?
Yes. X's markup reference describes twitter:site as the @username of the website, and this tool outputs exactly what you type without adding the @, so enter it as @yourhandle.
Can I use an SVG for the card image?
No. X's card documentation lists JPG, PNG, WEBP and GIF as supported formats and says SVG is not supported. For an animated GIF, only the first frame is used.
Is anything uploaded when I generate tags?
No. The tags are assembled in your browser. The image URL is copied into the output as text and never fetched.