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#
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?
The Design Tokens Community Group format, where each token has a $value and usually a $type, groups nest, and an alias is written in braces such as {color.blue.500}. It also reads the older spelling without the dollar sign (value and type) that Tokens Studio used before it adopted the standard.
How are aliases handled?
An alias becomes a reference rather than a copied value: var(--color-blue-500) in CSS and Tailwind, $color-blue-500 in SCSS. Change the base token and everything that points at it follows. The TypeScript output resolves aliases to their final values, since code usually wants the value itself.
What happens to shadows and typography tokens?
Composite tokens, such as a shadow with several parts or a typography style, can't be held by one CSS variable, so they are skipped and listed under the summary. Colours, dimensions, font families, weights, numbers and durations all convert.
How does the Tailwind output name tokens?
Tailwind v4 reads theme variables by namespace, so tokens are placed where utilities look for them: colours under --color-*, a spacing group under --spacing-*, radii under --radius-*, font families under --font-* and shadows under --shadow-*. A token named color.accent becomes --color-accent, which gives you bg-accent and text-accent.
