Skip to main content
SE

SVG Editor

A basic visual vector shape editor — rectangles, circles, lines, text and freehand paths, with select/move/resize and real SVG or PNG export.

Did you like the tool? Thanks!
Share:

More Image Tools Tools

IC

Image Cropper

Crop any image to exactly the area you need, with a live preview — nothing is uploaded, everything happens in your browser.

IR

Image Resizer

Resize any image to an exact width and height in your browser — optional aspect-ratio lock, PNG/JPEG/WebP output, nothing uploaded.

IC

Image Compressor

Shrink an image's file size by re-encoding it at a chosen quality level — live before/after size comparison, JPEG/WebP/PNG output, done locally.

IF

Image Flip & Rotate

Flip an image horizontally or vertically and rotate it by any angle — quick 90/180/270° buttons or a free-angle slider, corners never clipped.

IT

Image to Base64

Convert an image into a Base64-encoded string — full data URI or raw Base64, character count, one-click copy, all done locally.

BT

Base64 to Image

Paste a Base64 string or data URI and preview the decoded image instantly — auto-trims whitespace, lets you pick the assumed format, download in one click.

PI

Placeholder Image Generator

Generate a simple placeholder image for wireframes and mockups — custom size, colors and text, auto-sized to fit, PNG/JPEG/WebP output.

IF

Image Format Converter

Convert an image between PNG, JPEG, WebP and BMP entirely in your browser — no upload, instant preview, adjustable quality.

FG

Favicon Generator

Turn any image into a complete favicon package — six PNG sizes plus a combined multi-resolution .ico file, generated locally in your browser.

AA

ASCII Art Generator

Turn a photo into text-based ASCII art, or type a short message as a large block-letter banner — both rendered entirely in your browser.

Click a shape tool, then click (or click-drag) on the canvas to place it. Switch to Select to move a shape, drag its handle(s) to resize (Rectangle and Circle get a resize handle; Line gets two endpoint handles), or press Delete/Backspace. Freehand Path and Text can be moved and deleted but not resized in this core version.

How to Use SVG Editor

Choose a shape tool — Rectangle, Circle, Line, Text or Freehand Path — and click or click-drag on the canvas to place it. Switch to Select to click an existing shape, drag it to move it, drag its handle(s) to resize it, or press Delete. Bring to Front and Send to Back reorder overlapping shapes. Set fill, stroke color and stroke width for the selected shape (or the next one you draw), then export as a real, valid .svg file or as a PNG image.

About SVG Editor

Most "draw a shape online" tools quietly do one of two things under the hood: they either manipulate pixels on a canvas (like the Online Whiteboard tool in this same category), or they build up real, structured SVG markup as actual DOM elements. This tool deliberately does the second — every rectangle, circle, line, piece of text and freehand path you place is created with `document.createElementNS('http://www.w3.org/2000/svg', ...)`, the browser API for creating a real, namespaced SVG element, and appended directly into an actual `<svg>` element on the page. This distinction matters enormously for what you can do with the result afterward: because the drawing genuinely *is* SVG the whole time you're editing it (not a picture that gets converted to SVG at the end), exporting it is just a matter of serializing the real DOM you already have — which is exactly why the SVG download this tool produces is always valid, well-formed SVG rather than an approximation. The practical benefit of vector shapes over raster pixels is that everything stays *editable as a distinct object* for as long as you're working on it — unlike the Online Whiteboard's freehand strokes, which are permanently burned into pixels the moment you draw them, every rectangle, circle, line and text label here remains its own separate SVG element that you can click to reselect, drag to move, resize by dragging a handle, restyle, reorder in front of or behind other shapes, or delete — right up until the point you export. Selecting a shape shows a dashed outline and one or two small resize handles on its bounding box; dragging a handle updates that shape's actual width/height or radius attribute live, which is why the result stays crisp at any zoom level rather than degrading like a raster image would. A specific security detail is worth calling out directly, because it's easy to get wrong when building any tool that lets users type free text into a document: the Text tool never builds SVG by concatenating strings together and injecting the result with `innerHTML`. If it did, a user typing something like `<script>` or an SVG event-handler attribute into the text field could, in some contexts, have that content interpreted as live markup rather than plain text — a genuine cross-site-scripting risk. Instead, every text label is created as a real `<text>` DOM node, and your typed content is assigned to it via `.textContent`, which the browser guarantees is always treated as literal, inert text and never as markup to be parsed or executed — the same protection Alpine's own `x-text` binding relies on elsewhere in this codebase. This is also, separately, just the *correct* way to build real SVG programmatically, which is why it's used throughout this tool for every shape, not only for text. As with every tool in this batch, this is a genuinely useful core subset, not an attempt at a professional vector illustration suite like Illustrator or a browser-based design tool like Figma. There's no bezier curve editing, no grouping or layers panel beyond simple front/back reordering, no gradients or pattern fills, no snapping/alignment guides, and Freehand Path and Text shapes can be moved and deleted but don't get a resize handle in this version — resize is only implemented for Rectangle (a corner handle), Circle (a radius handle) and Line (two endpoint handles). That's a deliberate, documented trade-off: those five shape types plus select/move/resize/delete/reorder plus dual-format export cover the overwhelming majority of "I need to quickly mark up or compose a simple vector graphic" use cases without the complexity of a full illustration application.

Details & Tips

How coordinates are tracked: because the SVG canvas has its own coordinate system (declared by its `viewBox`) that can differ from its on-screen pixel size, every pointer interaction converts the raw mouse/touch position into true SVG coordinates using `svg.createSVGPoint()` and `point.matrixTransform(svg.getScreenCTM().inverse())` — the standard, always-correct way to convert screen pixels into a specific SVG element's internal coordinate space, regardless of how the SVG happens to be scaled on screen at that moment. Drawing each shape type updates a different set of live attributes as you drag: a Rectangle's `x`/`y`/`width`/`height`, a Circle's `cx`/`cy`/`r` (radius calculated as the straight-line distance from the center point to the current pointer position), a Line's `x2`/`y2` endpoint (while `x1`/`y1` stays fixed at the starting click), and a Freehand Path's `d` attribute, which is built by simply appending an `L x y` (line-to) command for every point captured on `pointermove`, after an initial `M x y` (move-to) starting command — this produces straight-line segments between every captured point rather than a smoothed curve, a deliberate simplification (no bezier curve fitting) that keeps the path-building logic simple and fully predictable, at the cost of a freehand path looking slightly more angular than hand-drawn ink would. Selecting a shape shows a highlight: a dashed outline rectangle is drawn around its bounding box (computed directly from its own x/y/width/height or cx/cy/r attributes for Rectangle and Circle, or via the browser's native `getBBox()` method for Line, Text and Path), plus small circular resize handles — one at the bottom-right corner for a Rectangle, one on the right edge for a Circle's radius, and two, one at each end, for a Line. Dragging a handle recalculates that one attribute (or pair of attributes) live as you drag; a shape can never be resized smaller than 3 SVG units in any dimension, which prevents a shape from accidentally collapsing to zero size and effectively disappearing. Move works by dragging anywhere on an already-selected shape's body (not on a handle): the tool records the shape's starting position attributes the moment the drag begins, then on every subsequent pointer movement applies the total x/y offset from the drag's start point to those original attributes — so the shape tracks the pointer smoothly rather than jumping or drifting. Bring to Front and Send to Back reorder the shape's actual position in the SVG's DOM tree, since SVG (like HTML) paints elements strictly in document order — a shape appended later in the markup always visually sits on top of one appended earlier, so "Bring to Front" literally moves the element to be the last child, and "Send to Back" moves it to be the first child drawn after the white background rectangle. Export: the SVG download works by cloning the live `<svg>` element, stripping out the selection-highlight and resize-handle elements (which exist only for editing and were never meant to be part of the final artwork), and serializing the clean result with `new XMLSerializer().serializeToString()` — the standard browser API for turning a real DOM tree back into a text string, which is guaranteed to produce syntactically valid markup because every element in that tree was created correctly in the SVG namespace from the start. PNG export takes that same serialized markup, turns it into an image via a `Blob` URL, draws that image onto an off-screen canvas at 2x the display resolution for a sharper result, and exports the canvas with `canvas.toBlob()` — the same technique used to rasterize any SVG into a bitmap image in a browser. Worked example: draw a rectangle, then switch to Select and click it — a dashed outline and one corner handle appear. Drag the handle to resize it, drag the shape's body to move it elsewhere, change the fill color (applies immediately to the selected shape), then draw a circle on top of it. Click the rectangle again and press "Send to Back" — it now paints beneath the circle. Click "Download SVG" and the file that downloads is the real, valid vector markup you were just looking at, minus only the editing-only selection outline and handles.

Frequently Asked Questions

Does this export a real, valid SVG file?
Yes. Every shape is built as a real SVG DOM element from the start (via createElementNS), not drawn as pixels or approximated afterward, so serializing it with the browser's XMLSerializer always produces syntactically valid, standards-compliant SVG markup.
Can I edit a bezier curve or smooth a freehand path?
No — Freehand Path uses straight-line segments between the points you draw (M/L commands only), not curve fitting. This keeps the path logic simple and predictable, at the cost of looking slightly more angular than hand-drawn ink.
Can I resize a Text label or a Freehand Path?
Not in this core version — resize handles are only implemented for Rectangle, Circle and Line. Text and Path can still be moved and deleted freely; resizing them is out of scope for now.
Is it safe to type any text into the Text tool, including symbols like < or &?
Yes. Your typed text is assigned to the SVG text element using .textContent, which the browser always treats as literal, inert text — never as markup to be parsed or executed — so it can never inject a script or event handler, regardless of what you type.
How does "Bring to Front" / "Send to Back" actually work?
SVG paints elements strictly in the order they appear in the underlying markup, just like HTML. These buttons literally move the selected shape's element to be the last (front) or first (back, just after the background) child in that markup.
Does the fill color apply to Line and Freehand Path shapes?
No — lines and paths are stroke-only shapes (fill is set to "none" so they render as open outlines, not filled areas). The fill picker only affects Rectangle, Circle and Text; stroke color and width apply to all shape types.
Does this support gradients, patterns, grouping or alignment guides?
No. This is a core subset covering five shape types plus select/move/resize/delete/reorder and dual-format export — not a full vector illustration suite. Advanced styling and layout aids like these are out of scope.
What happens if I draw a new shape overlapping an existing one?
It draws normally on top, regardless of which drawing tool is active — clicking with a drawing tool always starts a brand-new shape rather than accidentally editing whatever happens to be underneath the cursor.
Why did my tiny click not create a visible shape?
Shapes and lines smaller than 3 SVG units in size are treated as an accidental click rather than a deliberate drag and are discarded, so a stray tap doesn't leave an invisible zero-size shape cluttering the file.
Can I download a PNG instead of an SVG?
Yes — "Download PNG" renders your current drawing onto a canvas at 2x resolution for sharper output and exports it as a standard PNG image file, alongside the native SVG download option.
Is my drawing uploaded anywhere while I work on it?
No. Every shape lives only in your browser's DOM while you edit, and export happens entirely client-side — nothing is transmitted to a server at any point.

Part of These Collections

Also Available As

svg editor, online svg editor, vector shape editor, svg drawing tool, create svg online, svg maker

Found a Problem?

Let us know if something with SVG Editor isn't working as expected.

Thanks — we'll take a look.