X (Twitter) Card Generator
Control how your content appears when shared on X (Twitter).
About the X (Twitter) Card Generator
We built this tool to give you full control over how your links look when they are shared on X (formerly Twitter). When you share a URL, X "crawls" the page to find special meta tags called Twitter Cards. These tags tell X what image, title, and description to show. Without them, X might just show a plain link, which gets less attention.
Our generator makes it easy to create these tags. You just fill out a simple form, and we create the code for you in real-time. We also show you a live, high-fidelity preview so you can see exactly how your shared link will appear in the timeline. This helps you create professional, eye-catching links that can drive more clicks and engagement.
How to Use the Generator
- First, choose your "Card Type." The "Summary with Large Image" is usually best for engagement.
- Fill in your page's title, description, and the full URL of the page you are linking to.
- Add your site's and your own X @username. This helps attribute the content correctly.
- Provide a direct URL to the image you want to feature. Make sure it's a high-quality image.
- As you type, the preview on the right will update, and the code will be generated below it.
- When you are happy with the preview, click "Copy Tags" and paste the code into the
<head>section of your website's HTML.
Frequently Asked Questions
What are the different types of Twitter Cards?
There are a few types, but the main two are "Summary Card" and "Summary with Large Image." The Summary Card shows a small, square thumbnail, while the Large Image card shows a big, rectangular image. The large image card is generally better for grabbing attention and getting more clicks.
What is the best image size for a Twitter Card?
For a "Summary with Large Image" card, the best image size is 1200x628 pixels (a 1.91:1 ratio). For a standard "Summary" card, a square image of at least 144x144 pixels is best. Your image file should be under 5MB in size.
What is the difference between `twitter:site` and `twitter:creator`?
The `twitter:site` tag should be the @username of your website or business (e.g., @codeshackio). The `twitter:creator` tag should be the @username of the person who wrote the content (e.g., your personal handle). The site tag is more important, but it's good to include both if you can.
How can I test my Twitter Card after adding the tags?
X provides an official tool called the Card Validator. You can enter your URL there, and it will show you a preview of your card and point out any errors it finds. This is the best way to make sure everything is working correctly before you start sharing your link.
My card isn't updating on X. What can I do?
X caches the information from your links for about 7 days. If you update your meta tags, the old image and text might still show up. To fix this, you need to go to the X Card Validator, enter your URL, and click "Preview card." This will force X to recrawl your page and update its cache with the new information.