Convert SVG diagrams and Draw.io files to editable Visio (.vsdx), Draw.io (.drawio) and LibreOffice Draw (.fodg) files — directly in your browser. No server, no upload, no installation.
- SVG support — Paste SVG markup or drag & drop
.svgfiles - Draw.io support — Import
.drawioand.xmlfiles (including compressed diagrams) - Live preview — See your diagram rendered before converting
- Fully client-side — Everything runs in the browser, your data never leaves your machine
- Three exports —
.vsdx(Visio),.drawio(draw.io / diagrams.net),.fodg(LibreOffice Draw) - Editable output — Shapes, groups and connectors, not a flattened picture
- Open the converter
- Drag & drop a file (
.svg,.drawio,.xml) or paste the markup - Check the live preview
- Click Convert to .vsdx, .drawio or .fodg
- Open the file in Visio, draw.io or LibreOffice Draw — shapes, groups and arrows stay editable
- Shapes — rectangles, rounded rectangles, circles, ellipses, diamonds, polygons
- Connectors & Arrows — lines, polylines, paths with arrowheads on either or both ends, as real Visio 1-D connectors glued to their source and target, so moving a box takes its arrows along
- Text — labels inside shapes, standalone text, multi-line text,
<tspan>lines, per-line font size, weight, colour and alignment - Styles — CSS
<style>blocks andclassattributes, inherited properties, fill and stroke colours, line width, dash patterns (dashed / dotted / dash-dot), fill and stroke opacity, font size, bold - Frames — a box drawn around other shapes becomes a Visio group that declares itself a container, so dragging a subnet or a VNet moves everything inside it
- Layout — positions and sizes converted to Visio coordinates, including the
viewBoxorigin; shapes stay resizable because their geometry is written as formulas overWidthandHeight - Transforms —
translate,scale,rotate,skewandmatrix, composed correctly through nested groups - References —
<use>is expanded; gradients are flattened to a single colour
The converter reports these in the preview rather than dropping them silently:
<image>and<foreignObject>are skipped<textPath>text is placed at its anchor instead of along the pathclip-path,maskandfilterare ignored — shapes are converted unclipped- gradients and patterns become a flat colour
The pipeline is parse -> scene -> build, and the scene model is the contract
between the stages:
.svg -> SvgParser \
> Scene -> SceneLayout -> VsdxBuilder -> .vsdx
.drawio -> DrawioParser / \-> DrawioBuilder -> .drawio
\-> OdgBuilder -> .fodg
| File | Role | Needs a DOM |
|---|---|---|
scene-model.js |
The contract: JSDoc types, normalise(), validate() |
no |
svg-transform.js |
Affine transform maths | no |
svg-style.js |
The CSS cascade, inheritance and paint servers | yes |
svg-parser.js |
Walks the SVG DOM and produces a scene | yes |
drawio-parser.js |
Walks the Draw.io model and produces a scene | yes |
scene-layout.js |
Frame detection, label assignment, nesting, connector gluing | no |
vsdx-builder.js |
Scene to an OPC package | no |
drawio-builder.js |
Scene to native mxGraph XML | no |
odg-builder.js |
Scene to flat ODG (.fodg) |
no |
app.js |
Browser UI | yes |
Two rules keep this honest:
- Both parsers must produce the same scene.
SceneModel.validate()runs over every sample in the golden-file tests, so a parser that drifts from the contract fails loudly instead of producing a subtly wrong.vsdx. SceneLayoutfills gaps, it never overwrites. Draw.io knows its own edge endpoints and labels exactly; guessing geometrically would be strictly worse. The layout stage only derives what a parser left asnull.
Every layout threshold lives in SceneLayout.TUNING. When a drawing converts
badly, that is the first place to look.
npm ci
npm run check # lint + type-check + both test suites
npm test # unit/integration tests and golden-file snapshots
npm run build # regenerate dist/index.html
npm run preview -- diagram.svg out.svg # render what Visio will show
node tools/export.js diagram.svg outdir # write .vsdx, .drawio and .fodgTo try a change in the browser, open dist/index.html directly after a build,
or serve the project with npm start.
There is no bundler and no transpiler: the browser loads the sources directly,
and build.js inlines them into a single self-contained dist/index.html.
TypeScript is used as a checker only (npm run typecheck) — the types live
in JSDoc comments, so the files stay plain JavaScript.
-
test.js— unit and integration tests, including building a real.vsdxand validating every XML part in the package. -
test-golden.js— snapshots the parsed scene of every sample undertest-samples/intotest-golden/. Any change to a parser or a heuristic shows up as a reviewable diff:UPDATE_GOLDEN=1 npm run test:golden # after an intended change
tools/preview.js renders the generated Visio page back to SVG, which is the
only way to see what Visio will draw without owning Visio.
test-export.js builds a .drawio and a .fodg for every sample and checks
that edges are glued, frames are groups, and polyline waypoints survive.
npm run test:render (needs draw.io desktop and LibreOffice) exports every
sample, renders PNG from both apps, and moves a glued box to confirm the
arrows follow.
MIT — Third-party licenses: THIRD-PARTY-LICENSES