Polotno

Developer tool

SVG to JSON converter

Convert SVG to a structured JSON design tree in your browser. Output is the Polotno schema — typed elements with explicit position, color, font. Load into a canvas editor, edit programmatically, or feed to an LLM.

Quick answer

Drop an SVG, get a typed JSON tree (texts, images, paths) using the Polotno design schema.

Formula: SVG → Polotno JSON (browser-only)

Drop a SVG file here to convert it to JSON

or

Runs entirely in your browser. Your file never leaves your device.

Drop an SVG, get back a structured JSON tree in the Polotno design schema — every element typed (text, image, svg, line, group), every property explicit. Not the raw XML tree as JSON; a higher-level format built for canvas editors and programmatic manipulation.

What the JSON looks like

The output is a Polotno design: a top-level width / height and a pages array (always one page for an SVG input). Each page has a children array of typed elements — text, image, svg (for path-heavy fragments), line, group. Geometry is in pixels; colors are hex strings.

Use cases

  • Loading SVG assets into a canvas editor — the Polotno editor SDK loads this JSON directly via store.loadJSON(). Useful when shipping SVG icon libraries as editable starting points in a design tool.
  • Programmatic edits — tweak colors, positions, or text values via straight object access, then re-render.
  • LLM-friendly data— feed the structured tree to a model that's better at JSON than at SVG markup.

The same conversion in code

import { svgToJson } from "@polotno/svg-import";

const text = await file.text();
const json = await svgToJson({ svg: text });

// Load into a Polotno store
import { createStore } from "polotno/model/store";
const store = createStore({ key: "YOUR_KEY" });
store.loadJSON(json);

Full API reference: SVG Import docs.

Frequently asked questions

Want this in your app? Embed Polotno SDK.

TRUSTED BY

100,000+

CREATORS

300+

BUSINESSES

ExpediaUnbounceLovePopPostGridPredis.ai