SVG code editor
MEMBERSWrite SVG and see it drawn, or draw and see it written. Mistakes are named with their line, and colours are shown beside it.
Canvas
Canvas
The code cannot be read. The canvas shows the last version that could.
Fill
Stroke
Text
Place and size
Effects
Nothing is selected. These are the properties of the drawing.
Drawing
Press an element to select it, arrows move it, Delete removes it, Ctrl D copies it. V selects, A edits points, P is the pen, R a rectangle, O an ellipse, T a text. Layers hold every element for the keyboard.
Code, live both ways
Code, live both ways
Weight
What the file weighs
All optimizations
Found a bug or missing something? Write to us
How it works
The code and the drawing are one thing
There is no import or refresh between them: the canvas draws what the code says and changes the code it is about. Select an element and its lines are marked; type and the element moves.
While a tag is unfinished the canvas keeps the last readable version and waits. The message names the line and what is wrong there, such as an element that ends under another name.
Duplicate ids, references to things that are not there, a missing viewBox, namespace or title are found, and several can be put right with a press.
Help
FAQ
What do the four numbers of viewBox mean?
The x and y of the top left corner, then the width and the height of the area that is shown: viewBox="0 0 24 24" spreads 24 units over whatever size the SVG gets. Scales with its place (no fixed size) removes width and height and keeps the viewBox, so CSS alone sets the size.
How is an SVG made readable for screen readers?
A drawing with meaning needs a title element as the first child of svg and role="img", so that screen readers say the title; a decoration gets aria-hidden="true" instead. Title for screen readers in the properties of the drawing writes both the title and the role.
Why does an SVG file show as text or not at all?
A file opened on its own, or used in an img element, needs xmlns="http://www.w3.org/2000/svg" on the svg element; without it the browser does not treat it as SVG. Inside an HTML page the same code works, which is why the check No namespace is worth reading.