Pure Frontend · Custom Property Extraction · Auto-Grouping · Unused Detection · Multi-Format Export
Zero Dependencies · Works OfflineThe CSS Variable Extractor is a pure frontend online tool for extracting all custom properties (CSS Custom Properties, i.e., variables starting with --) from CSS code. It automatically parses CSS, identifies variable definitions and references, groups them by color, spacing, font, border, and other categories, detects unused variables, and supports export to CSS custom properties, SCSS variables, JSON design tokens, and Tailwind configuration. All parsing is done locally in your browser—no code is ever uploaded to any server.
--variable-name definitions, including those in :root, body, and any selectorStep 1: Paste CSS code in the input box, drag-and-drop a .css file, or click "Load Example".
Step 2: Click "Extract Variables" or press Ctrl+Enter to automatically parse and display all variables.
Step 3: View the grouped variable list with color swatches for color variables and red flags for unused ones.
Step 4: Select an export format (CSS/SCSS/JSON/Tailwind) and click "Copy" or "Download" to save results.
Extract design tokens from existing CSS to build a unified design variable system and ensure design consistency.
Discover unused CSS variables, clean up redundant code, and reduce CSS file size.
Migrate CSS custom properties to SCSS variables or Tailwind configuration for different tech stacks.
Extract all color and spacing variables to quickly create dark/light theme variants.
CSS Custom Properties start with -- and are referenced via var(--name). Unlike preprocessor variables, CSS custom properties are runtime variables that support cascade, inheritance, and JavaScript dynamic modification. Naming conventions recommend --category-property-variant format, e.g., --color-primary-500, --spacing-md. Design Tokens are the practice of abstracting design decisions into reusable variables, and CSS custom properties are the native Web standard for implementing design tokens.
Extracts all CSS custom properties (variables starting with --), including those defined in :root, body, and any selector, as well as variables referenced via var().
Yes. Auto-groups by color, spacing, font, border, etc. Export to JSON, SCSS variables, CSS custom properties, and more.
No. All CSS parsing and variable extraction is performed locally in your browser. Code never leaves your device.
Yes. The tool checks which variables are referenced via var() and marks those that are only defined but never used.
Yes. Drag a .css file directly into the input area to load and analyze it.
Export as CSS custom properties, SCSS variables ($name), JSON design tokens, or Tailwind configuration.