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
- 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.
- 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.
- 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.
- 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 enter | DTCG $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, #FFF8 | Converted 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 #000 | Same with inset: true |
| Two comma-separated shadows | An array of two shadow objects |
- Colours are stored as numbers, not strings. DTCG 2025.10 wants a colour space plus components; the tool writes sRGB components rounded to 4 decimals and adds the hex as a fallback, so tools such as Style Dictionary and Terrazzo can read it without guessing.
- Keep em, % and fluid values out of tokens, or store them as plain strings in your own extension; the dimension type deliberately allows only px and rem.
- Enter wide-gamut colours as hex or rgb() for now. OKLCH values are skipped rather than converted; convert them to sRGB first if you need them in the JSON.
- Names: token names may not start with $ or contain { } or . (the format reserves them for types, references and paths); such rows are skipped with a message.
- Other exports (CSS custom properties, SCSS, Tailwind v3 config and Tailwind v4 @theme) take the values as typed, so em, % and oklch() pass through there.
Sources
Checked on .
Frequently Asked Questions
๐ 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