SVG color utility

Invert SVG Colors

Upload an SVG, flip its colors, preview the result, and download an inverted SVG or PNG.

Runs Locally

This tool runs in your browser. Files never leave your device.

Upload your SVG
Color inversion happens in your browser.
Waiting for upload

Practical details

How Invert SVG Colors handles your file

What gets inverted

The tool reads parseable colors in direct SVG attributes and inline style declarations. It can change fill, stroke, color, gradient stop colors, and supported flood or lighting effect colors. Values such as none, transparent, and currentColor are left alone.

Fill versus stroke

Fill paints the inside of a shape and stroke paints its outline. Their controls are independent, so you can invert a filled icon, an outline icon, or both. Turning black artwork white is usually better handled with strict black-and-white mode than with full inversion of every color.

Dark backgrounds and transparency

Changing a shape's color does not fill transparent canvas space. Keep the background transparent for an asset that should sit on the page background, or deliberately add the optional white rectangle when the downloaded file needs its own solid backdrop.

SVG and PNG output

The SVG download keeps editable vector markup with the changed color values. The PNG download renders that result to a browser canvas at the SVG's natural dimensions, so it is a fixed-size raster image rather than a vector file.

Original fill-and-stroke inversion

This original example uses a dark blue fill and a warm outline. Full RGB inversion subtracts each red, green, and blue channel from 255; the geometry and transparent background stay unchanged.

Before
<circle fill="#123456" stroke="#f0c080" cx="32" cy="32" r="24"/>
After
<circle fill="#edcba9" stroke="#0f3f7f" cx="32" cy="32" r="24"/>

If the goal were only to make pure black artwork white, strict black-and-white mode would avoid changing unrelated colors like the outline.

Real limitations

  • Colors defined in style elements, CSS classes, external stylesheets, variables, currentColor, or unsupported formats such as HSL are not rewritten.
  • Embedded raster images are not recolored, and paint values that reference a resource with url(...) are not themselves parsed as colors.
  • Gradient stop attributes can be changed, but complex CSS-driven gradients and effects still require a visual review.
  • Hex colors with embedded alpha are converted to six-digit inverted colors; use the preview to catch any transparency change before downloading.

What this tool does

Invert SVG Colors reverses parseable direct color values in SVG attributes and inline styles. Use full inversion for a color negative, or limit the change to pure or near-black and white artwork when preparing a monochrome icon for a different background.

How it works

Upload an SVG, choose full or black-and-white inversion, and control fills, strokes, and supported effect colors separately. Preview the result, then download the edited SVG or a rendered PNG. The SVG content is processed in your browser.

When to use Invert SVG Colors

Making a dark-mode version of a light icon
Testing a design at inverted contrast
Creating a negative of a graphic
Flipping artwork to suit a dark background

FAQ

Does it invert every SVG color?

It inverts supported direct color attributes and inline style values. Colors from classes, style elements, CSS variables, currentColor, unsupported color formats, or embedded raster images are not rewritten.

What is the difference between fill and stroke inversion?

Fill changes shape interiors; stroke changes outlines. You can enable either control or both.

Does inversion remove transparency?

Values such as none and transparent, plus separate opacity attributes, are left unchanged. Hex colors that include an alpha channel are rewritten as six-digit colors, so preview those files carefully.

Is the PNG still a vector file?

No. The SVG download keeps vector markup; the PNG is a fixed-size canvas rendering.