ColorToolkits
Format Converter

Hex to Tailwind CSS Token Converter

Convert any HEX color into a Tailwind CSS v4 @theme custom OKLCH token and link straight to a full 50–950 scale.

Converted (Tailwind v4 Token)
--color-custom: oklch(0.546 0.215 262.9);
#2563EB
Try presets:

How to Use This Tool

  1. Enter or paste your HEX value or choose one of the curated preset swatches.
  2. Copy the formatted Tailwind v4 Token value directly, or inspect the secondary HEX, RGB, HSL, and OKLCH chips below.
  3. Click into Tailwind Scale Generator or Contrast Checker to validate accessibility on the converted shade.

Key Features

  • Bidirectional parsing supporting CSS Color Level 4 syntax cleanly
  • Tailwind v4 replaces JavaScript tailwind.config.js color objects with CSS-first @theme blocks using perceptual OKLCH tokens that unlock arbitrary opacity modifiers like bg-brand/50.
  • Instant clipboard feedback with live OKLCH and Display-P3 gamut safety
  • Zero server round-trips—every calculation executes immediately in browser memory

Formatting Brand HEX as Tailwind v4 @theme OKLCH

Tailwind v4 replaces JavaScript tailwind.config.js color objects with CSS-first @theme blocks using perceptual OKLCH tokens that unlock arbitrary opacity modifiers like bg-brand/50.

Reference Snippet (CSS (@theme))

@import "tailwindcss";
@theme {
  --color-brand: oklch(0.546 0.215 262.9);
}

Frequently Asked Questions

More Color Tools

View all tools →