Star on GitHub

Design tokens converter

Paste a design tokens file in the DTCG JSON format and get CSS custom properties, a Tailwind v4 theme, SCSS variables or a typed TypeScript object. Aliases stay references, and nothing leaves your browser.

Converter#

Check it against the spec

14 tokens: 7 colours, 6 dimensions, 1 font family, 2 aliases

Output
:root {
--color-blue-500: #2f6fed;
--color-blue-600: #2459c9;
--color-accent: var(--color-blue-500); /* Primary actions, links, focus rings */
--color-accent-hover: var(--color-blue-600);
--color-surface: #ffffff;
--color-text: #16181d;
--color-text-muted: #5b6270;
--spacing-1: 4px;
--spacing-2: 8px;
--spacing-4: 16px;
--spacing-6: 24px;
--radius-sm: 6px;
--radius-md: 10px;
--font-sans: Satoshi, system-ui, sans-serif;
}

What does the input look like?#

Each token is an object with a $value, and usually a $type such as color, dimension or fontFamily. Groups nest, and a $type set on a group applies to every token inside it. An alias points at another token by its path in braces, so {color.blue.500} means the token at color, then blue, then 500.

This is the format published by the W3C Design Tokens Community Group. Tokens Studio, Style Dictionary and most Figma variable exporters can write it, which is why it is the one to standardise on. Not sure a file follows it? The design tokens validator checks it against the 2025.10 spec, line by line, and can rewrite an older file.

How do I convert Figma variables?#

Export the variables to JSON first, with a variables export plugin or Tokens Studio set to the W3C format, then paste or open the file here. If your file has one set per mode, such as light and dark, convert each one and scope the second under a selector like [data-theme="dark"] instead of :root.

Why do tokens matter for AI coding tools?#

Cursor, Claude Code and similar tools write raw values such as #3b82f6 and 10px when they don't know your token names. Converting tokens into variables is the first half of the fix; the second is letting the assistant look them up while it writes. The walkthrough Stop your AI hard-coding hex colours builds a small MCP server that does that, and Orvain UI's MCP server does it for the whole Orvain library.

Questions#

Is my tokens file uploaded anywhere?

No. The conversion runs in your browser, so the file you paste or open never leaves the page.

Which JSON format does the converter read?

How are aliases handled?

What happens to shadows and typography tokens?

How does the Tailwind output name tokens?