Contents
  1. The short answer
  2. Method 1: Merge SVG files in a vector editor
  3. Method 2: Merge SVG files by editing the code
  4. Problems that commonly appear after merging
  5. How to verify the merged file
  6. Before you combine someone else's logo
  7. Gaps in this guide

The short answer

To merge SVG files, bring their contents into a single SVG document. You can import each file into a vector editor and export once, or you can copy each file's shapes into one root svg element in a text editor. In both cases you then set a viewBox (the coordinate area the file displays) that fits all the artwork, fix any duplicate IDs, and check the combined file in more than one viewer.

"Merging" can mean two different things in logo work, and you should decide which one you need before you start. Combining files puts several separate pieces of artwork into one document, such as a symbol and a wordmark that become a lockup. Merging shapes joins several paths into one outline with a boolean union, or into a compound path (a single path object built from several subpaths, which can include holes). The second kind is a geometry operation, and you can do it after the files are combined.

Method 1: Merge SVG files in a vector editor

This route is usually the most reliable for logo artwork because the editor handles coordinates, transforms and most internal references for you. Common choices include Adobe Illustrator, Inkscape, Affinity Designer and Figma. Menu names differ between applications, but the workflow is the same.

  • 1. Create a new document or open the main SVG.
  • 2. Import or place the other SVG files. Make sure they come in as editable vectors and not as linked or embedded images.
  • 3. Arrange the pieces, then group each piece so it can be moved as one unit.
  • 4. If you need a single outline, select the paths and apply a union or make a compound path. Keep an unmerged copy, because this step is hard to undo later.
  • 5. Fit the artboard or canvas to the artwork, or add the margin you want around it.
  • 6. Export or save as SVG. Choose plain or optimized SVG if the file goes to the web, and choose the editor's native format for your working master.

Method 2: Merge SVG files by editing the code

SVG is a text format, so you can also combine files by hand. This works well for simple, clean files. It needs more care when the files contain gradients, clipping paths, masks or embedded style sheets.

  • 1. Open each SVG in a text editor and note its viewBox values.
  • 2. Create one root svg element and keep the xmlns attribute from your source files on it.
  • 3. Paste the inner content of each file (everything between its opening and closing svg tags) into its own g (group) element.
  • 4. Position each group with a transform attribute such as translate, so the pieces do not overlap.
  • 5. Move all defs content (gradients, clip paths, masks, symbols) into one defs block, and rename any IDs that appear in more than one file. Then update every reference to those IDs.
  • 6. Check any style blocks for class names that conflict. Two files can both use a class called cls-1 with different fills, and the later rule will then restyle the earlier artwork.
  • 7. Set the root viewBox so it covers the combined artwork.

Here is the basic structure. The numbers are placeholders, not recommended dimensions.

<svg viewBox="0 0 300 100">
  <!-- keep the xmlns attribute from your source files on this element -->
  <defs>
    <!-- gradients, clip paths and masks from all files, with unique IDs -->
  </defs>
  <g id="symbol">
    <!-- inner content of the first file -->
  </g>
  <g id="wordmark" transform="translate(110 0)">
    <!-- inner content of the second file -->
  </g>
</svg>

If the goal is a set of icons stored in one file for web use, and not a single composed logo, the usual structure is a sprite. In a sprite, each graphic is wrapped in a symbol element with its own ID and viewBox, and pages reference individual symbols with a use element. Command-line optimizers and sprite-building tools can automate this. The ID-collision issues described above still apply.

Problems that commonly appear after merging

Symptom | Likely cause | Fix
Part of the artwork is cut off or the file has extra empty space | The root viewBox does not match the combined artwork | Recalculate the viewBox or fit the artboard to the artwork in an editor
A gradient or clipped shape looks wrong or disappears | Two files used the same ID in their defs | Give each ID a unique name and update its references
Colors change on one piece | Conflicting class names in style blocks | Rename the classes or convert styles to inline attributes
Text changes typeface | Live text depends on fonts the viewer does not have | Convert text to outlines in the master artwork before delivery
Pieces shift or scale unexpectedly | Nested transforms or differing units in the source files | Apply or flatten transforms in an editor before combining

How to verify the merged file

  • Open the file in at least two different viewers, such as a web browser and a vector editor, and compare how it renders.
  • Search the code for duplicate id values.
  • Search for image elements. An SVG can contain embedded raster images (pixel-based pictures), so the .svg extension alone does not prove that the artwork is fully vector or editable.
  • Search for text elements. If any remain, decide whether the delivered logo should depend on installed fonts.
  • Zoom in closely on joins and overlaps. If you ran a union, check that unwanted gaps, stray points or reversed holes did not appear.
  • Confirm the viewBox has the margin you intend and does not trim strokes at the edges.

Being able to open and merge an SVG does not mean you are permitted to reuse or alter the logo inside it. Brand owners often restrict lockups, spacing and color changes. When you combine a third-party mark with your own artwork, as in co-branding, check the owner's guidelines or get permission first.

Gaps in this guide

No tool-specific measurements, version details or test results were available for this guide. The steps above describe general SVG structure and common editor workflows. Exact menu names, export settings and how a particular tool handles IDs and styles vary, so check the documentation for the application you use.