Great question! In Tailwind CSS, the text size scale is designed to be intuitive and responsive, using classes like text-sm, text-base, text-lg, up to text-9xl and beyond (depending on your Tailwind version and configuration).
✅ Tailwind CSS Default Text Size Hierarchy
Here's the default hierarchy of text sizes in Tailwind CSS (v3.x), from smallest to largest:
| Class | Font Size (font-size) | Line Height (line-height) |
|---|
text-xs | 0.75rem (12px) | 1rem |
text-sm | 0.875rem (14px) | 1.25rem |
text-base | 1rem (16px) | 1.5rem |
text-lg | 1.125rem (18px) | 1.75rem |
text-xl | 1.25rem (20px) | 1.75rem |
text-2xl | 1.5rem (24px) | 2rem |
text-3xl | 1.875rem (30px) | 2.25rem |
text-4xl | 2.25rem (36px) | 2.5rem |
text-5xl | 3rem (48px) | 1rem (usually overridden) |
text-6xl | 3.75rem (60px) | — |
text-7xl | 4.5rem (72px) | — |
text-8xl | 6rem (96px) | — |
text-9xl | 8rem (128px) | — |
❓ What About text-1xl?
There’s no class called text-1xl in Tailwind by default.
text-xl → extra large
text-2xl → 2 extra large
- So
text-1xl doesn’t exist because it would be redundant with text-xl.
If you try to use text-1xl, Tailwind will not apply any styles, and you’ll see a warning if you're using a linter or have dev tools open.
🛠 Custom Sizes (Optional)
You can add custom sizes in your tailwind.config.js file:
theme: {
extend: {
fontSize: {
'1xl': '1.375rem', // e.g., 22px
}
}
}
But again, this isn't standard and should only be used when necessary.
✅ Summary
- ✅ Use
text-xl, text-2xl, etc.
- ❌ Avoid
text-1xl – it doesn't exist in Tailwind.
- The sizes scale smoothly from
text-xs to text-9xl.
- If you need something between
text-lg and text-xl, customize Tailwind.
Let me know if you want a chart for dark mode or responsive sizing too!