Editing the Paths of an SVG Favicon
How to edit path data in an SVG favicon: what the path element contains, how to check that a file holds real vector paths, editor and hand-editing workflows, and small-size and rights caveats.
Contents
Editing the contours of an SVG favicon means changing the geometry stored in the file's path elements. You can do this visually, by moving anchor points and handles in a vector editor, or directly, by rewriting the coordinates in the path's d attribute. Both methods only work if the file contains real vector paths. Many files with an .svg extension do not, so check the file first, then edit, then regenerate any raster favicon versions that came from the old artwork.
What a path is in an SVG file
In SVG, a path element describes a shape as a sequence of drawing commands stored in its d attribute. Fill, stroke and other paint properties are applied to that outline. A favicon is usually a small set of these paths, sometimes with a few basic shapes such as rect or circle, placed inside a coordinate system defined by the root element's viewBox. When you edit a contour, you edit these commands and their coordinates. The rendered pixels are drawn from them.
| Command | Meaning | Typical favicon use |
| M / m | Move to a point without drawing | Start a new shape or subpath |
| L / l | Straight line to a point | Diagonal edges |
| H / h | Horizontal line | Square corners and bars |
| V / v | Vertical line | Square corners and bars |
| C / c | Cubic Bézier curve with two control points | Smooth letterforms and organic curves |
| S / s | Smooth cubic curve that reflects the previous control point | Continuing a curve without a visible kink |
| Q / q | Quadratic Bézier curve with one control point | Simple arcs and bulges |
| T / t | Smooth quadratic continuation | Chained quadratic curves |
| A / a | Elliptical arc | Rounded corners and circular segments |
| Z / z | Close the current subpath | Closing a filled shape |
Uppercase commands use absolute coordinates within the viewBox. Lowercase commands are relative to the current point. This matters when editing by hand. Changing one absolute coordinate moves one point. Changing an early relative coordinate shifts every point that follows it in the same subpath.
<!-- A 32-unit square icon: one square with a square hole cut out -->
<path d="M4 4 H28 V28 H4 Z M12 12 V20 H20 V12 Z" fill="#1a1a1a"/>
In this example, the second subpath runs in the opposite direction to the first. Under the default nonzero fill rule, that reversed direction is what makes it cut a hole. If you reverse the direction of one subpath while editing, the hole can fill in. Setting fill-rule to evenodd removes that dependency on direction.
Check that the file actually contains editable paths
An .svg extension or a file named favicon.svg does not prove there are vector contours inside. Open the file in a text or code editor before you plan any edits, and look at which elements it uses.
- Vector artwork: path, rect, circle, polygon and similar elements with coordinate data. These can be edited as contours.
- Embedded raster image: an image element, often holding a long base64 data string. This is a bitmap wrapped in SVG. There are no contours to edit, and the only vector route is redrawing or tracing it.
- Live text: a text element that depends on a font. It renders differently or falls back to another font where that font is unavailable. To edit letter shapes, convert the text to outlines, if the font license allows it.
- Strokes rather than fills: the outline you see may be a stroked centerline. Moving its nodes moves the centerline, and stroke width scales with the viewBox. Converting the stroke to a filled outline gives more predictable results at favicon sizes.
- Raster previews: favicon.ico and PNG icons are pixel images. Even when they were exported from the SVG, they contain no paths.
Editing paths in an SVG path editor
Vector editors show the d attribute as anchor points and Bézier handles that you can drag, add, delete or convert between corner and smooth. Desktop applications such as Inkscape and Adobe Illustrator, design tools such as Figma, and various browser-based SVG path editors all provide this kind of node editing. The commands that prepare shapes differ by tool. Inkscape offers Object to Path and Stroke to Path. Illustrator offers Outline Stroke and Create Outlines. Figma offers Outline stroke and Flatten. No comparative testing of these tools was supplied, so this article does not rank them.
- Open the SVG and confirm that the artboard or canvas matches the viewBox, ideally a square.
- Convert strokes and text to filled paths where the icon depends on exact shapes.
- Use the node tool to adjust contours. Delete redundant points instead of stacking many small corrections.
- Combine overlapping shapes with boolean operations (union, difference, intersection) so the icon is built from few, clean paths.
- Simplify carefully. Automatic simplification can soften corners that matter at small sizes.
- Export as plain SVG instead of an editor-specific format, so editor metadata and private namespaces are left out.
- Reopen the exported file in a text editor and confirm it contains the expected path elements and no embedded image.
Editing path data by hand
For simple geometric favicons, direct editing of the d attribute is often faster and more precise than dragging nodes. Snapping coordinates to whole units of the viewBox keeps edges aligned with the pixel grid when the icon is rendered at a size that divides evenly into the viewBox. That alignment helps keep horizontal and vertical edges crisp. Curved paths exported from editors tend to use long decimal coordinates and relative commands. Those are hard to read by hand, so they are usually better adjusted in a visual editor.
Optimization tools that minify SVG can round coordinates, merge paths, convert shapes to paths and remove IDs or classes. This shrinks the file but can break CSS that targets specific elements, or blur small details. Keep an unoptimized master file for future editing and treat the optimized copy as the delivery file.
Favicon-specific considerations
A favicon is shown very small, so path edits should serve legibility rather than detail. Thin strokes, tight counters and fine gaps can disappear or blend together when rasterized at tab size. Preview the edited file at the small sizes where it will actually appear, not only zoomed in.
Because an SVG favicon can contain a style element, the paths can respond to a prefers-color-scheme media query, for example by switching their fill in dark mode. This is a documented SVG and CSS capability. Whether a given browser applies it to favicons is a separate question, and the supplied material contains no current support data.
<svg viewBox="0 0 32 32">
<style>
path { fill: #1a1a1a; }
@media (prefers-color-scheme: dark) {
path { fill: #f5f5f5; }
}
</style>
<path d="M4 4 H28 V28 H4 Z M12 12 V20 H20 V12 Z"/>
</svg>
<!-- A standalone file also needs the standard SVG xmlns attribute on the root element; it is omitted here for brevity. -->
The page declares an SVG favicon with a link element using rel="icon" and type="image/svg+xml". Browser and platform support for SVG favicons has historically been uneven, and some contexts, such as home-screen and app icons, use separately supplied raster images. The usual practice is to keep PNG or ICO fallbacks alongside the SVG. After editing the paths, re-export those raster versions from the updated master so every version shows the same artwork.
<link rel="icon" type="image/svg+xml" href="...">
Permission to edit is separate from access to the file
Being able to download a favicon or logo file does not give you the right to modify it. The artwork may be protected by copyright, the letterforms may come from a font whose license restricts conversion to outlines or modification, and the mark itself may be a trademark. Edit your own artwork or files you are licensed to alter. Treat a third-party brand's favicon as reference only, unless its owner's terms or brand guidelines allow changes.
Gaps in the available evidence
The material behind this article contained no confirmed specifications, tool benchmarks, browser support tables or file examples. The SVG path syntax and editing principles above are general, verifiable features of the format. Recommendations about simplification, pixel alignment and keeping raster fallbacks are editorial guidance, not measured results. Check current browser documentation for SVG favicon and dark-mode support, and the license terms for any font or third-party artwork involved.