Swelıty
Tools for everyone

Free Online Tailwind CSS Playground

Write HTML with Tailwind CSS classes and watch the preview update as you type. Uses Tailwind CSS 4, with a CSS tab and a tailwind.config.js tab for your own theme.

Auto-run is on, so the preview updates as you type. Tailwind CSS 4 is loaded for you, and scripts in the HTML do not run. The CSS tab is Tailwind CSS, and the tailwind.config.js tab takes your theme, which is converted to Tailwind 4.

Preview

How to use

  1. Write HTML with Tailwind classes in the HTML tab.

  2. Optionally add your own components and styles in the CSS tab.

  3. Add your own theme in the tailwind.config.js tab, such as a brand colour or a font, and use it as a class, for example bg-brand or font-display.

  4. Watch the preview update as you type, or turn off Auto-run and press Run.

  5. Copy the code, download a zip of your files or clear the editor with the icons above it.

  6. Open the full screen editor for more room, and use the A buttons to resize the text.

  7. Press Format to tidy the tab you are editing, or untick Wrap long lines to scroll sideways instead.

Why use this tool

  • Tailwind CSS 4

    The current version of Tailwind, compiled in the preview as you type.

  • A tailwind.config.js tab

    Write the config object you know. Colours, fonts, font sizes, spacing, screens, radius, shadows, keyframes and dark mode are converted to Tailwind 4 theme values, and each name becomes a class.

  • Live preview

    See each change a moment after you stop typing.

  • Scripts are blocked

    The preview does not run scripts in your HTML, so it can update live without risk.

  • One-click formatting

    Tidy the indentation and spacing of the tab you are editing with one click or Shift + Alt + F.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Write HTML with Tailwind CSS utility classes and see the result live, with no build step. This online Tailwind playground runs Tailwind CSS 4 in the preview, so you can try classes, test a layout, build a component or learn Tailwind quickly. The CSS tab takes Tailwind's own CSS and the tailwind.config.js tab takes a familiar config object, so you can add your own colours, fonts, spacing, screens, shadows and animations and use them as classes.

Frequently asked questions

Tailwind CSS 4, using its browser build, which is loaded from a public CDN.

No. The preview blocks scripts so it can update as you type. To run JavaScript, use the JavaScript Playground.

In the tailwind.config.js tab, add a colour under theme.extend.colors, for example brand with a hex value. You can then use it in classes such as bg-brand. A key named DEFAULT is the plain name, and other keys become shades, such as bg-brand-dark.

Yes, a subset. The tailwind.config.js tab reads the config object as plain data and converts the supported parts to Tailwind 4 theme values. Plugins, presets, functions and options such as content need a build tool, so they are skipped, and a notice in the tab lists what was left out.

Under theme and theme.extend: colors, fontFamily, fontSize, fontWeight, letterSpacing, lineHeight, screens, spacing, borderRadius, boxShadow, dropShadow, blur, transitionTimingFunction, animation and keyframes. Also darkMode set to class or selector. Anything else under theme is not converted, and the notice suggests an arbitrary value or the CSS tab instead.

Treat it as a prototype. Tailwind's browser build is meant for trying things out. For a real site, use Tailwind's build tools so only the CSS you use is shipped.

Yes. Press Format, or Shift + Alt + F while you are typing, to tidy the tab you are editing. If the code has a syntax error it is left unchanged and the problem is shown under the editor.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.