SVG Code Editor

Change the markup and watch the drawing keep up. This SVG code editor highlights the syntax, formats or minifies on one click, and points at the exact line when the XML will not parse.

Live preview

100%
The preview appears here as you type

Edit SVG code online free of charge — no account. The markup is parsed and drawn in this browser tab and is never uploaded.

Reviewed by SVGMaker TeamUpdated

What you can edit

What This SVG Code Editor Is Good For

Anything that arrives as markup rather than as a picture. These are the files people open here, and the change they usually came to make.

Paths copied out of an icon set, where the fill or the stroke width is one attribute away from right.
Icon markup
Output from a design tool: correct but verbose, full of editor metadata worth stripping before it ships.
Exported files
Coordinates typed by hand, where a single wrong number is invisible in text and obvious in the preview.
Hand-written shapes
Markup a script produced, opened here to check what it actually draws before it goes anywhere.
Generated output
SVG destined to sit inside HTML, where size and tidiness matter because the markup ships with the page.
Inline snippets
Definitions referenced by id, where the preview tells you instantly whether the reference resolved.
Gradients and defs
Paths copied out of an icon set, where the fill or the stroke width is one attribute away from right.
Icon markup
Output from a design tool: correct but verbose, full of editor metadata worth stripping before it ships.
Exported files
Coordinates typed by hand, where a single wrong number is invisible in text and obvious in the preview.
Hand-written shapes
Markup a script produced, opened here to check what it actually draws before it goes anywhere.
Generated output
SVG destined to sit inside HTML, where size and tidiness matter because the markup ships with the page.
Inline snippets
Definitions referenced by id, where the preview tells you instantly whether the reference resolved.
Gradients and defs

How it works

How to Edit SVG Code Online

To edit SVG code online: put the markup in the editor, change it, and read the result beside it. Nothing is uploaded — the parsing and the drawing both happen in this browser tab.

How to Edit SVG Code Online
  1. 1

    Load the markup

    Paste it in, or open a file from disk. Either route lands in the same editor, with the syntax colored so tags, attributes and values are told apart at a glance.

  2. 2

    Change it and watch

    An svg code preview online sits beside the editor and redraws as you type. Break the XML and the editor marks the line instead of going blank, which is the part that usually saves the time.

  3. 3

    Tidy it and take it

    Format to make it readable, minify to make it small, then copy the markup or download the file. Both buttons work on your code, not on a copy of it.

What it does

What an SVG Code Editor Has to Get Right

Highlighting, so the shape of the file is visible

SVG is XML, and unhighlighted XML is a wall. Tag names, attribute names and values each get their own color here, which is what makes it possible to scan a long path element and find the one attribute you came for. Bracket matching and folding come with it, so a deeply nested group can be collapsed out of the way while you work on its neighbor.

Open the editor
Highlighting, so the shape of the file is visible

Format and minify, both without changing the drawing

Format re-indents the document one element per line so the structure is readable. Minify runs the same compressor our download pipeline uses: comments and metadata go, coordinates are rounded only as far as the viewBox allows, and whitespace between elements collapses. Neither one touches text content or alters what the file draws — the preview beside the editor is how you confirm that.

Try both
Format and minify, both without changing the drawing

Errors with a line number, not a blank rectangle

A browser rendering broken SVG shows nothing at all, which tells you nothing at all. Here the markup goes through the same parser our upload path uses, so an unclosed tag, a duplicate attribute or a stray character comes back as a message with a line and a column. Click it and the cursor lands there.

See it in action
Errors with a line number, not a blank rectangle

A preview that is safe to point at anything

SVG is an executable document: it can carry scripts, event handlers and references to anything outside the file. Those are stripped before the preview draws, along with style blocks and link containers, so opening a file from a source you do not control cannot run anything here. Your code is left exactly as you wrote it — only the picture is cleaned, and the editor says so when the two differ.

How it stays safe
A preview that is safe to point at anything

What you get

What This SVG XML Editor Gives You

Syntax highlighting

Tags, attributes and values in different colors, with bracket matching and folding for long documents.

Preview beside the code

The drawing redraws as you type, so you never have to guess which line owns which shape.

One-click formatting

Re-indent a minified one-liner into something readable without pasting it through another tool.

One-click minifying

Strip the parts that never render and shrink the file, with the byte count before and after.

Errors you can find

Broken markup gets a line and a column instead of an empty box, so fixing it is a jump, not a hunt.

Nothing uploaded

The markup stays in this tab. Nothing is stored, and there is no link to expire afterwards.

When you need it

When You Need an SVG File Editor

Most SVG work is a small change to a file somebody else produced. These are the moments the code is the fastest way in.

Recoloring an icon

One fill attribute stands between the icon and your palette. Changing it in the markup is faster than reopening a design tool.

Recoloring an icon

Fixing a broken export

A file that renders as nothing usually has one malformed tag. The error message names the line, so the fix is a jump.

Fixing a broken export

Slimming a file before it ships

Exported SVG carries editor metadata and long decimals. Minifying strips both without changing a pixel of the drawing.

Slimming a file before it ships

Preparing markup to inline

SVG that will live inside HTML has to be small and tidy, because it ships with every page that uses it.

Preparing markup to inline

Adjusting a viewBox

Cropping or re-centering means changing four numbers. Seeing the result immediately is what makes that practical.

Adjusting a viewBox

On a machine without tools

A free svg code editor in the browser lets you edit svg online when the change takes thirty seconds and installing anything does not.

On a machine without tools

Which tool

Which Tool Fits

Every one of them is free, needs no account, and runs locally. What separates them is depth: how far into the file each reaches.

Which Tool Fits
ToolBest forWhat it changesCost
SVG EditorMoving, recolouring and reshaping artwork on a canvas.Objects on a canvasFree, no account
SVG Path EditorPulling one curve into shape, anchor by anchor.Anchors and handlesFree, no account
SVG Code EditorReading and fixing the markup itself.The XML sourceFree, no account
SVG ViewerSeeing what a file draws, without changing it.Nothing — read onlyFree, no account

FAQ

SVG Code Editor Questions

It is a text editor that understands SVG markup and draws it while you work. SVG is XML, so editing it is editing text; what an editor adds is syntax coloring, a live preview and a parser that tells you where the document broke instead of failing silently.

Open Your SVG in the Editor

Paste the markup or open a file, and edit it with the drawing beside you. It runs in this browser tab, costs nothing, and nothing is uploaded.

Open the editor
Need to make one rather than edit one? Start from the svg maker.