Menu

SVG Color Replacer

Upload an SVG file, detect every fill and stroke color, replace any of them with a new color, and download the updated SVG.

1. Upload SVG STAYS LOCAL

Your SVG never leaves your device. All parsing and editing happens in the browser.

2. Detected colors

Upload an SVG to see its fill and stroke colors.

Click a color to load it in the replace panel. Colored swatches reflect the current color after replacement.

3. Replace a color

→

Pick a color from the detected list, then choose a new color. Every occurrence of the original color across fills, strokes, inline styles, gradients, and CSS style blocks will be replaced.

4. Applied changes

No changes yet.
✓ Copied!
SVG EDITOR • COLOR REPLACER • BROWSER ONLY

SVG Color Replacer

Every SVG carries its colors inside the file — as fill, stroke, inline styles, or inside a <style> block. This tool reads them, lets you change them, and writes a clean new SVG. No design software, no uploads, no dependencies.

FillSolid shape colors
StrokeOutline colors
Style blocksInside <style>…</style>
GradientsStop, flood, lighting colors
01
HOW IT WORKS

How the Tool Parses Your SVG

The SVG file is loaded into an in-memory DOM. The tool walks every element and reads its fill, stroke, and inline style properties. It also scans any <style> block for CSS rules. Any value that resolves to a color is collected and its usage count is tracked.

01

Read

Parses attributes, inline styles, gradient stops, and CSS rules.

02

Group

Aggregates identical colors, showing how many elements use each one.

03

Replace

Swaps every occurrence — including named colors and CSS classes.

02
WHAT GETS REPLACED

Supported Color Sources

  • fill attribute: fill="#2563eb", fill="red"
  • stroke attribute: stroke="#ef4444"
  • Inline styles: style="fill:#2563eb;stroke:#111827"
  • CSS style blocks: .cls-1 { fill: #2563eb; }
  • Gradient stops: <stop stop-color="#ff0000">
  • SVG filters: flood-color, lighting-color
  • Named colors: red, blue, white, black, etc. — auto-converted to HEX
  • Preserved: currentColor and var(--name) are skipped so theming keeps working
03
USE CASES

When to Use It

  • Icon libraries: change the fill of an icon set from one brand color to another in one pass.
  • Illustrations: swap an accent color across a complex SVG without opening Illustrator.
  • Design handoff: adjust SVGs to match new brand tokens quickly.
  • Dark mode assets: convert black strokes to white for dark-theme variants.
  • Print-ready files: replace RGB colors with print-safe alternatives.
  • Open-source projects: quickly adjust third-party icon colors to match your palette.
04
BEST PRACTICES

SVG Color Editing Tips

  • Check the preview before downloading. Some SVGs use opacity or gradients that change how colors look.
  • Multiple stacked replacements are supported. Apply several changes, then download the final file in one pass.
  • CSS variables are preserved. The tool skips var(--name) and currentColor values so you can still theme them later.
  • Always keep the original. Save the edited file under a new name so you can revert if needed.
  • Watch for cached colors. Some SVGs use filters or gradients that don't respond to fill/stroke changes.
05
FAQS

SVG Color Replacer FAQ

Is my SVG uploaded to a server?

No. The tool parses and modifies the SVG entirely in your browser using the DOM API. Nothing is sent anywhere.

What formats are supported?

Any valid SVG file — including SVGs exported from Figma, Illustrator, Sketch, Inkscape, and hand-written SVGs.

Will it replace colors inside gradients?

Yes. Colors inside <stop> elements of gradients are detected and can be replaced.

What about CSS style blocks?

Yes — CSS rules inside <style> tags that define fill or stroke are detected and replaced. This is common in SVGs exported from Illustrator.

What about CSS variables?

Values like fill="var(--primary)" and fill="currentColor" are preserved — the tool intentionally skips them so theming keeps working.

Can I undo a replacement?

Yes. Each change appears in the "Applied changes" list. Click the × next to a change to revert it, or use "Reset all changes" to start over.

Can I download the modified SVG?

Yes. Click "Download SVG" to save the updated file with all applied changes.

Edit SVG Colors in Seconds

No design software needed. Upload an SVG, detect every color, replace what you want, and download the updated file. Everything is private, fast, and works offline after the first load.