PerfectVector
Studio
By Irene Kim

How to Change SVG Colors and Fix Common Issues

Recolor SVG fills and strokes in an editor or code, diagnose CSS and embedded-image issues, and keep color changes separate from Cricut cut geometry.

13 min read
On this page

To change an SVG's colors, edit the paint that belongs to its shapes: usually fill for an interior and stroke for an outline. Use a vector editor, a compatible browser tool, or the SVG code itself. If the visible part is an embedded raster image, these path-paint methods will not recolor its pixels.

Keep an untouched copy and use an SVG-capable viewer to check the saved result. This guide helps you choose a method, diagnose changes that do not appear, and keep recoloring separate from structural changes needed for cutting.

The quick version
  • Browser workflow: use a tool that supports the fills, strokes, and other features in your file, then check its exported SVG.
  • Vector editor: Inkscape or Illustrator lets you select a shape or several objects sharing the same paint.
  • One-color icon: open the file in any text editor and change the hex after fill=.
  • SVG on a website: parent-page CSS can target inline paths. A file loaded through <img> can use its own internal styles, but parent-page selectors cannot reach those paths.
  • Refuses to change at all? It may be a raster image wrapped in an .svg shell. Path fill edits cannot recolor embedded pixels. Edit the raster source, or trace it with an image vectorizer when you need geometry.

Where an SVG keeps its colors

An SVG file is a list of shapes written as text. Each shape can carry a fill for the inside and a stroke for the outline, as described in MDN's SVG fill-and-stroke guide. There is no single "image color" you can swap in one place. A design that reads as one color on screen may be a single tidy path, or it may be forty separate paths that all happen to share the same fill.

Paint may be inherited from a group, defined by a class, or supplied by a gradient. Find the paint rule responsible for the visible object before replacing a color.

Pick your method

What you're holdingUseWhy
SVG with solid fills supported by the toolBrowser color toolCheck that it lists all intended fills and strokes
Multi-color artwork you want precise control overInkscape or IllustratorSelect by shape or by shared color, see everything
A one-color icon (or a whole folder of them)Text editorFind and replace one hex value
Inline SVG on a websiteParent-page CSSPage selectors can target its live shapes
Existing vector artwork with groups or style rulesInspect and repair the SVGRetains usable geometry without tracing it again

Method 1: an online SVG color changer

  1. Choose a browser SVG color tool whose supported features match your file, and upload a working copy.
  2. The tool lists the colors it finds. The useful ones group identical fills, so "the blue" is one swatch even if it covers dozens of shapes.
  3. Click a swatch, pick the replacement, and watch the preview.
  4. Download the result and open it once in a browser tab to confirm.

Check whether the tool handles strokes, internal styles, gradients, masks, and embedded content. A missing swatch can also reflect an unsupported or inherited paint rule; inspect the file rather than assuming every visible color is a simple fill.

Method 2: a vector design app

A vector editor offers object selection and paint controls. The labels and import support differ by app, so use the instructions for the app you have.

  1. Open the SVG and click the part you want to change. If the whole design selects as one block, it's grouped: double-click to enter the group, or ungroup it.
  2. Change the fill in Inkscape's Fill and Stroke panel or the corresponding paint control in your editor.
  3. When one visual color is split across many shapes, don't click them one by one. Right-click a shape and use Select Same → Fill Color in Inkscape, or use Illustrator's documented Select → Same → Fill Color. Every shape sharing that fill is now selected, and one change recolors them all.
  4. Export or save as plain SVG.

A design app is also where you'd go beyond color, like moving shapes or reworking curves. For that bigger toolbox, see our guide to editing an SVG.

Method 3: a text editor

Because an SVG is text, any editor works: Notepad, TextEdit, VS Code.

  1. Open the .svg file and search for fill=.
  2. Change the value, for example fill="#1e3a5f" to fill="#c2410c", and save.
  3. Refresh the file in a browser tab to check the result.

Three caveats. Colors can be written as names (fill="black") as well as hex. Outlines live in stroke=, not fill=. And many exported files don't put the color on the shape at all: they use classes, with the actual hex sitting in a <style> block near the top (.st0{fill:#1e3a5f;}). Edit the hex in the style block and every shape with that class follows.

This method shines for one-color icons, where a single find-and-replace does the job, and for batch work across a folder. For a forty-color illustration, it's the slow way.

If your SVG lives on a website

Can you change an SVG's color with CSS? The most direct route is inline SVG markup in the HTML. Then fill works like a CSS property, and setting fills to currentColor lets the icon inherit surrounding text color. An SVG loaded as an external <img> is treated as an image; MDN notes that JavaScript cannot manipulate the SVG structure in that setup, and page styles do not directly select its internal paths.

An external SVG can still contain its own <style> element, as MDN documents. Edit that file's styles or paint attributes and reload it. Parent-page CSS isolation does not mean CSS is forbidden inside the SVG. For the delivery choice, compare inline SVG with an external image using the same artwork and a page CSS test.

For a one-colour interface silhouette, SVG CSS masks and transparent icon shapes provide another route: paint the icon element with CSS while leaving the source image's path colours alone.

For a reversible color effect, compare feColorMatrix with direct fill edits. A filter changes the rendered colors while leaving the source paints intact, which matters when delivering editable artwork.

Minimal fill example

Save this as an SVG and open it in a browser. The triangle uses the blue fill value. Replace #1e3a5f with #c2410c, save, and reload: the color changes while the d geometry stays the same.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
  <path fill="#1e3a5f" d="M12 2 L22 20 H2 Z" />
</svg>

For an inline version in HTML, a page selector can set the path's fill. For an <img> version, edit the SVG's own paint rule instead. If a stronger CSS rule overrides a fill attribute, update that rule rather than repeatedly replacing the attribute.

Why your SVG won't change color

Match the visible symptom to the paint or structure responsible for it.

SymptomLikely causeFix
CSS has no effect on the pageFile is loaded via <img>Inline the SVG, or edit the file itself
The whole design selects as one blockEverything is groupedDouble-click into the group, or ungroup
Fill changes but the visible color doesn'tYou changed the fill; the color you see is a strokeChange stroke too
Swatch edits do nothing in a text editorColors live in a <style> block as classesEdit the hex in the style block
A colored box appears behind the designA background rectangle is its own shapeSelect and delete or recolor it separately
Visible artwork is an image object and pixelatesIt's a raster image wrapped in an .svgEdit the raster source or trace it if paths are needed

Two of these deserve a closer look.

The background-box surprise

Some SVGs carry a full-size background rectangle you can't see against a white page. Recolor "everything" and the box shows up as a colored block behind your design; some apps also select it when you click. It's a normal shape, so select it and delete it, or give it the color you actually want. If the box turns up white in other software, that's a related but different problem, covered in our guide to keeping a transparent background.

The SVG that isn't a vector

The stubborn case looks like this: no shape is selectable, every fill edit does nothing, and when you zoom in, the edges pixelate. Open the file in a text editor and instead of <path> elements you'll find one <image> tag holding a wall of base64 text. That's a raster picture wrapped in an .svg shell. Converters that don't actually trace produce these, and path fill edits cannot repaint its pixels. Raster editing or a deliberate tint effect is a separate operation. The two files look identical on screen, but in the code the difference is obvious:

<!-- A real vector: a shape with a fill you can change -->
<path fill="#1e3a5f" d="M12 2 L22 20 H2 Z" />
 
<!-- A raster in an .svg shell: one sealed picture, no shapes -->
<image href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..." />

The fix is to go back to the picture itself, ideally the original PNG or JPG, and convert it into a real vector with real paths. Our guide to SVGs that still look pixelated digs into how these fakes happen and how to spot one before you rely on it. After tracing, check the resulting shapes and paint rules before recoloring them.

Recoloring a cut file does not merge its shapes

A material color, an SVG group, and a cut outline are different things. Cricut's upload help says SVGs designed with layers retain those layers. Giving two objects the same fill does not guarantee that they import as one layer or become one continuous cut shape.

For Cricut, Weld joins overlapping cut geometry; Attach preserves placement on a mat. Cricut's crafting terminology guide explains those operations. Recoloring alone does neither.

Merge near-duplicate palette entries only when they serve the same visual or material role. Then inspect the Layers panel, operation type, and mat preview in Design Space. Retain intentional separate colors. Our layered-SVG guide covers structure, while palette reduction covers choosing which colors to combine. If you need separate aligned downloads, use the exact-color SVG separation workflow.

What this looks like with PerfectVector

For a usable SVG you already have, start with direct editing. PerfectVector's separate SVG color separator accepts supported SVG artwork and produces files by exact color; separation is not geometric welding or general recoloring.

If you need paths from a raster source, use PerfectVector to convert the image to SVG, compare the free preview with the original, then unlock the result before using its color editor. One credit unlocks editing and export, as described in the product facts. After each recolor or palette merge, check that intended details and contrast remain.

PerfectVector editor example with a multicolor illustration and palette swatches
This retained editor example shows palette-based editing. It does not show the account unlock step; current result editing follows unlocking.

What a recolor can't do

  • Gradients aren't one swatch. A gradient is a ramp between color stops. You can edit the stops, but a plain "replace this color" pass may only move part of the ramp, which is why gradient art looks odd after a naive swap.
  • Screen colors aren't print colors. SVG stores screen-oriented color instructions, while a print job may need an exact brand, spot, or black build. If an export changes what you see, diagnose the SVG color shift before replacing the palette; the print shop's requested production format remains the color authority.
  • Recoloring doesn't clean geometry. New fills won't merge slivers, close gaps, or reduce nodes. A messy trace with new colors is still a messy trace.

Before you save

  • Open the recolored file fresh in a browser tab and compare it against the original.
  • Check outlines: did strokes change along with fills where they should?
  • Look for a stray background rectangle you may have accidentally recolored.
  • For cut files, check designed layers, material colors, operation types, and cut outlines in the destination app.
  • Keep an untouched copy of the original file.

FAQ

How do I change the color of an SVG file without Illustrator or Photoshop? Use Inkscape, a compatible browser SVG tool, or a text editor for a simple file. Change the relevant fill, stroke, or style rule, then reopen the saved SVG to verify it.

Why does my SVG stay black no matter what I try? Parent-page CSS cannot target paths inside an SVG loaded through img, although the SVG can contain its own styles. In an editor, check strokes, inherited paint, overriding style rules, and groups. If the visible part is an embedded raster image, path fill edits will not recolor its pixels.

Can you recolor an SVG in Canva? Canva's dedicated SVG editor says you can upload, recolor, and download an SVG for free without a watermark. Complex SVG features can still render differently across editors, so inspect the downloaded file before replacing the original.

Can one SVG file use more than one color? Yes. Every shape in the file carries its own fill and stroke, so an SVG can hold as many colors as it has shapes, plus gradients. That's also why recoloring multi-color art means changing several fills, not one global setting.

How do I change SVG colors for a Cricut project? Inspect the imported Layers panel and change the intended material colors. Shared fill values do not guarantee one imported layer or a merged cut outline. Use the appropriate geometry or placement operation, such as Weld or Attach, when the project requires it.

Does changing an SVG's color reduce quality? Changing a vector paint value can leave its geometry unchanged, so it does not blur path edges. A tool may also simplify, flatten, or change other features during export; compare the saved file with the original.

Sources

  1. MDN: SVG fills and strokes — Explains fill, stroke, opacity, and related SVG paint properties.

  2. MDN: Adding vector graphics to the web — Compares inline SVG with SVG loaded through <img>.

  3. Adobe Illustrator: Select objects with the same fill and stroke — Documents selecting artwork by shared paint attributes.

  4. W3C: SVG 2 embedded content — Defines raster <image> content inside SVG documents.

  5. Canva: SVG editor — Current source for Canva's SVG upload, recolor, and download claims.

  6. MDN — SVG style element — Internal SVG styles remain distinct from parent-page CSS.

  7. Cricut — How to upload images into Design Space — Designed-layer behavior on SVG import.

  8. Cricut — Crafting terminology — Weld and Attach solve geometry and placement tasks.


For an existing SVG, change the responsible paint rule and compare the saved result with your original. If you need geometry from a raster image, preview a vector conversion, then unlock before editing and exporting it.

More from the blog

PerfectVector

Start with a cleaner SVG
that is easier to edit

Vectorize and inspect previews for free, with no daily limit.