Convert SVG Colors to Hex

Normalize rgb(), hsl(), and named colors to #RRGGBB — leave variables and currentColor alone

Named colors → hex? Named colors → hexReplace color? Replace color

FAQ

Quick answers

How do I convert SVG colors to hex?
Click Convert to hex. fill, stroke, and stop-color values written as rgb(), hsl(), #RGB, or CSS names become #RRGGBB. Inline style paints are included.
How is this different from Convert SVG Colors to CSS Variables?
Variables replace colors with var(--svg-cN) tokens. Hex conversion keeps a hardcoded palette and only changes the notation, which Figma, some CNC tools, and email clients prefer.
Does this convert colors to currentColor?
No. currentColor, none, and url(#…) paints are left alone. Use Colors → currentColor if you need inheritance.
What happens to rgba() with alpha?
The RGB channels become hex. Alpha is written as an 8-digit #RRGGBBAA value so opacity is not thrown away.
Named colors → hex → Replace color → Colors → CSS variables → Colors → currentColor →
Open full editor →

Source

Type or paste SVG markup. The preview on the right updates as you type.

Ready

Live preview

PNG export · 2× for retina