Design Token Generator

What Is a Design Token Generator?

Design tokens are the atomic values โ€” colors, spacing, typography scales, border radii, shadows โ€” that keep a design system consistent across platforms. Instead of hardcoding hex values or pixel sizes in every file, tokens provide a single source of truth that designers and developers share.

This generator starts you with a working set of 34 tokens in five groups (colours, spacing, font sizes, radii and shadows). Edit, add or remove any of them, then export the same set as CSS custom properties, SCSS variables, a Tailwind v3 config, a Tailwind v4 @theme block, or JSON in the W3C Design Tokens Community Group format (2025.10). Copy it or download the file.

How to Use This Tool

  1. Define your color palette โ€” Edit the starter colours or add your own. Names are yours to choose (the starter set uses purpose names such as primary, surface and danger), and values can be any CSS colour: hex, rgb(), hsl() and so on.
  2. Set spacing and sizing scales โ€” The starter spacing scale runs xs to 3xl (4 to 64 px, mostly on an 8 px grid). Change any step or add your own; the tool does not calculate a scale for you.
  3. Configure typography tokens โ€” Font-size tokens start at xs to 4xl (12 to 36 px). Edit them directly; font families and line heights are not part of this tool, so add those by hand or with the Typography Scale tool.
  4. Export in your target format โ€” Pick CSS, SCSS, Tailwind v3, Tailwind v4 or DTCG JSON, then Copy Output or Download. Each export was checked with the real consumer: Dart Sass compiles the SCSS, Node loads the v3 config, the Tailwind v4 CLI builds utilities such as bg-primary and p-md from the @theme block, and the Terrazzo parser reads the JSON.

Worked example: what goes into the DTCG JSON

On October 12, 2026 we fed the tool's own parsers a range of CSS values in Chromium and recorded the DTCG token each one produced. Values a parser cannot express are listed under Skipped below the export, not silently changed.

You enterDTCG $value
#00AAFF{colorSpace: "srgb", components: [0, 0.6667, 1], hex: "#00aaff"}
rgb(255 51 102 / 50%)sRGB components [1, 0.2, 0.4] with alpha 0.5
hsl(220 90% 56%), tomato, #FFF8Converted to sRGB components (#FFF8 keeps alpha 0.533)
oklch(0.7 0.15 250)Skipped: OKLCH input is not parsed (the format itself allows an oklch colorSpace)
16px, 1.5rem, 0{value: 16, unit: "px"} etc.; unitless 0 becomes 0 px
2em, 50%, clamp(โ€ฆ)Skipped: DTCG dimensions allow only px and rem
0 1px 2px rgba(0,0,0,0.05)Shadow object (color, offsetX, offsetY, blur, spread)
inset 0 2px 4px #000Same with inset: true
Two comma-separated shadowsAn array of two shadow objects

Frequently Asked Questions

What is the difference between a design token and a CSS variable?+
A CSS variable is one implementation of a design token. Tokens are platform-agnostic values; CSS variables are how those values land in a stylesheet. Tokens can also export to SCSS, JSON, Swift, or Android XML.
Do I need a design system to use tokens?+
No. Even a solo project benefits from tokens. They centralize magic numbers so a rebrand or theme change means updating one file instead of hundreds of lines scattered across components.
Which export format should I pick?+
Plain CSS or any framework without a build step: CSS custom properties. A Sass pipeline: SCSS. Tailwind 3: the v3 config (paste theme.extend into tailwind.config.js). Tailwind 4: the v4 @theme block in your main CSS file. Handing tokens to other tools such as Style Dictionary, Terrazzo or a design tool: DTCG JSON.
Can I import an existing token set?+
Not yet; the tool has no import. Edit the starter rows or add rows and paste your existing names and values into them.
How do tokens interact with Tailwind CSS?+
In Tailwind 4, theme variables live in CSS: the v4 export is an @theme block using Tailwind's namespaces (--color-*, --spacing-*, --text-*, --radius-*, --shadow-*), so a token named primary becomes bg-primary and text-primary, and spacing md becomes p-md. In Tailwind 3, the v3 export goes under theme.extend in tailwind.config.js and produces the same class names.
Are design tokens only for large teams?+
Not at all. Tokens prevent drift even on solo projects. They are especially valuable when you maintain multiple sites or white-label products that share a core design but differ in branding.
Which token spec does the generator follow?+
The DTCG JSON export follows the Design Tokens Format Module 2025.10, the first stable version, published by the W3C Design Tokens Community Group on October 28, 2025. Each token has $type and $value; colours are objects with colorSpace srgb, components from 0 to 1, alpha when not 1 and a hex fallback; spacing, font sizes and radii are dimensions with a value and a unit; shadows are shadow objects (an array for layered shadows). The spec only allows px and rem for dimensions, so tokens in other units are left out and listed above the output. Aliases ({group.token} references) are not generated.
Can I export to multiple formats from one token file?+
Yes. All five exports come from the same token list, so switching format re-renders the same names and values. There is no TypeScript or JavaScript-module export; for more targets, export DTCG JSON and feed it to a build tool such as Style Dictionary or Terrazzo.

๐Ÿ“– Learn More

Related Article Design Tokens & Systems: The 2026 Guide โ†’ Related Article CSS Custom Properties (Variables): The Complete Guide โ†’

Built by Derek Giordano ยท Part of Ultimate Design Tools

Privacy Policy ยท Terms of Service