A laptop, a phone and a hand writing in a notebook on a wooden desk, banner image on the Figma to Code page

Tools / Build suite

Figma to Code

Turn a Figma frame into clean HTML and CSS - export the frame as SVG and paste it here

The handoff gap is real: the design lives in Figma, the engineer needs markup. In Figma, right-click the frame and Copy as SVG (or export it), then paste below. The converter reads the actual shapes - real positions, real colors, real text - and gives you HTML and CSS you can read, plus a live preview and a download. Everything runs in your browser; nothing is uploaded.

Open the standalone workspace

Screenshot of the Figma to Code tool

Paste exported SVG

Worked example

Real output, from the tool itself.

This is what Figma to Code returned for the example input shown, captured from the tool itself - not a mockup.

You enter

Exported SVG (pasted)

<svg width="320" height="180" viewBox="0 0 320 180" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="320" height="180" rx="16" fill="#5a5a5a"/><text x="24" y="52" font-size="28" fill="#ffffff" font-family="Inter">Hire faster</text><rect x="24" y="76" width="120" height="36" rx="8" fill="#ffffff"/><text x="44" y="99" font-size="15" fill="#5a5a5a" font-family="Inter">Sign up</text></svg>

The tool returns

Generated HTML

<div class="frame">

  <div class="rect"></div>
  <div class="text">Hire faster</div>
  <div class="rect-2"></div>
  <div class="text-2">Sign up</div>
  </div>

Generated CSS

.frame { position:relative; width:320px; height:180px; overflow:hidden; margin:24px auto; background:#fff; }
.rect { position:absolute;left:0px;top:0px;width:320px;height:180px;background:#5a5a5a;border-radius:16px; }
.text { position:absolute;top:24px;font-size:28px;font-family:Inter;white-space:pre;color:#ffffff;left:24px; }
.rect-2 { position:absolute;left:24px;top:76px;width:120px;height:36px;background:#ffffff;border-radius:8px; }
.text-2 { position:absolute;top:84px;font-size:15px;font-family:Inter;white-space:pre;color:#5a5a5a;left:44px; }
Try it with your own input

What it does

From the shapes, not a guess.

Real design data

Figma's SVG export carries exact sizes, positions, fills, corner radii and text with its fonts. The code is derived from that data, not eyeballed.

Private by design

You paste the SVG yourself, so private team files work fine - nothing is fetched and nothing leaves your browser. There is no Figma connection to authorize.

Readable output

Class names come from your layer names, colors are hex, text keeps its content and font size. It is a faithful static rendering to build from.

Clear about scope

Output is static HTML and CSS. Rectangles, circles, lines and text become elements; complex paths stay as inline vector so nothing is lost. Auto-layout becomes fixed positioning; interactive components, variants and prototypes are out of scope.

Copy as SVG is the whole bridge

Right-click a frame in Figma, Copy as SVG, paste. No plugin, token, or account connection.

Four shapes become elements

Rectangles, circles, lines and text nodes turn into positioned HTML elements with matching CSS.

Real values, not guesses

Sizes, positions, fills and corner radii are read from the SVG's own attributes and styles.

Sandboxed preview

The generated page renders in an isolated frame on the same screen, so you see the result before downloading.

Clean class names

Layer names are lowercased, dasherized and capped at 40 characters, so the CSS reads like yours.

One file out

Download a single .html file with the markup and styles together, ready to open or adapt.

How it works

SVG in, markup out.

Step 1

In Figma, right-click the frame and choose Copy/Paste as, then Copy as SVG (or use Export in the right panel).

Step 2

Paste the SVG markup above and convert - the shapes load for inspection.

Step 3

Check the live preview, copy the HTML and CSS, or download the single file.

FAQ

Do I need a Figma token or account connection?

No. You export the SVG from Figma yourself and paste it, so nothing connects to your Figma files and private team files work the same way.

What about auto-layout?

It is rendered as precise fixed positioning - visually faithful, structurally simple. Re-flow it to flexbox as you build.

Images and complex vectors?

Images become labeled placeholders with their exact bounds. Complex paths are kept as inline SVG at the right position and size, so the rendering stays faithful.

Which Figma export?

Copy as SVG on the frame. That markup carries the positions and fills the converter reads.

Does it handle images?

Image fills and linked assets are skipped; shapes and text convert. Check the preview for what came through.

Where does my design go?

Nowhere. Conversion runs in your browser tab; the SVG is never uploaded.

Responsive?

The output is absolutely positioned, matching the frame. Adapt it to a fluid layout in your own editor.

More in the Build suite

Font Pairing LabWebhook TesterPricing Page BuilderLanding Page MakerStatus Page Starter
A laptop, headphones, a camera, a phone and a plant on a white desk, seen from above, banner image on the Figma to Code page

Try it now.

Figma to Code runs in your browser. No account needed.

Input To Output

SVG in, HTML and CSS out

SVG copiedfrom FigmaA live previewGenerated HTMLGenerated CSSA .htmldownloadFigma to CodeInOut
InSVG copied from FigmaFigma to CodeA live previewGenerated HTMLGenerated CSSA .html downloadOut
A pasted Figma frame becomes positioned shapes in a page.

Pipeline

Four steps

Right-click theframe in FigmaChoose Copy as SVGPaste it into theboxConvert, thendownload
Right-click the frame in FigmaChoose Copy as SVGPaste it into the boxConvert, then download
From Figma to a file.

Spec Sheet

Nine tags become elements

rectdiv: size, fill, border,radiuscircle, ellipsediv with border-radius 50%linerotated divtextdiv with the words and fontimagelabeled placeholder boxpath, polyline, polygonkept as inline SVG
rectdiv: size, fill, border, radiuscircle, ellipsediv with border-radius 50%linerotated divtextdiv with the words and fontimagelabeled placeholder boxpath, polyline, polygonkept as inline SVG
What each SVG tag turns into.

Pipeline

Walking the tree

Enter svg, g, aand switchAdd up translate()offsetsSkip defs, masks,patterns andsymbolsStop after 24levels of nesting
Enter svg, g, a and switchAdd up translate() offsetsSkip defs, masks, patterns andsymbolsStop after 24 levels of nesting
Containers are entered, offsets add up.

Before After

Rect to CSS

SVG attributeCSSx and ywidth and heightfillstrokerxleft and topwidth and heightbackgroundborderborder-radius
SVG attribute to CSSx and yleft and topwidth and heightwidth and heightfillbackgroundstrokeborderrxborder-radius
A rectangle becomes a box.

Before After

Circle to CSS

SVG attributeCSScx and cyrfillstrokeleft and top from the centerwidth and height of twice rbackgroundborder
SVG attribute to CSScx and cyleft and top from the centerrwidth and height of twice rfillbackgroundstrokeborder
A circle becomes a round box.

Before After

A line becomes a rotated div

Line endpointsDiv0,0 to 100,00,0 to 100,10010,10 to 10,60100px long, rotate 0deg141.42px long, rotate 45deg50px long, rotate 90deg
Line endpoints to Div0,0 to 100,0100px long, rotate 0deg0,0 to 100,100141.42px long, rotate 45deg10,10 to 10,6050px long, rotate 90deg
Length from the hypotenuse, angle from atan2.

Spec Sheet

How positions are computed

Root viewBoxoffset subtracted oncetranslate()added down the treeDecimalsrounded to two, in pxMissing sizeviewBox, else 800 x 600
Root viewBoxoffset subtracted oncetranslate()added down the treeDecimalsrounded to two, in pxMissing sizeviewBox, else 800 x 600
Every element lands at absolute coordinates.

Spec Sheet

Class name rules

Sourceid or data-nameCaselowercased, runs becomedashesLeading digitx prependedLength cap40 charactersName repeats-2, -3 and so onNo namefalls back to the shape kind
Sourceid or data-nameCaselowercased, runs become dashesLeading digitx prependedLength cap40 charactersName repeats-2, -3 and so onNo namefalls back to the shape kind
Layer names become safe class names.

Before After

Layer names to classes

LayerClassHero Card3D IconHero Card (second)hero-cardx3d-iconhero-card-second
Layer to ClassHero Cardhero-card3D Iconx3d-iconHero Card (second)hero-card-second
Examples.

Spec Sheet

Gradients

On kept vectorsdefs survive with the svglayerurl(#id) fillskept on vectorsurl() fills on shapesdroppedExternal urlsnever kept
On kept vectorsdefs survive with the svg layerurl(#id) fillskept on vectorsurl() fills on shapesdroppedExternal urlsnever kept
Kept where they can be honored.

Spec Sheet

What the sanitizer strips

on* handlersremovedhref, xlink:hrefremovedstyle and classremoved from vectorsidremoved from shapesNon-local url()set to none
on* handlersremovedhref, xlink:hrefremovedstyle and classremoved from vectorsidremoved from shapesNon-local url()set to none
Pasted markup is cleaned before use.

Pipeline

Previewing safely

The full documentis built in memoryShown inside aniframe srcdocHTML and CSS shownin text areasNothing is sentanywhere
The full document is built inmemoryShown inside an iframe srcdocHTML and CSS shown in text areasNothing is sent anywhere
The result renders without leaving the page.

Spec Sheet

The five status messages

Empty pastePaste SVG markup first.Over the size limitToo large (2 MB max).UnparseableCould not parse that as SVG.Root is not svgNot an SVG document.Nothing convertibleNo convertible shapes found.
Empty pastePaste SVG markup first.Over the size limitToo large (2 MB max).UnparseableCould not parse that as SVG.Root is not svgNot an SVG document.Nothing convertibleNo convertible shapes found.
What the tool can tell you, messages shortened.

Spec Sheet

Hard limits

Paste size2,000,000 charactersNesting depth24 levelsClass name length40 characters
Paste size2,000,000 charactersNesting depth24 levelsClass name length40 characters
Constants in the converter.

Spec Sheet

The output layout

Frameposition: relativeEvery elementposition: absoluteFrame overflowhiddenVectorsone svg layer on top
Frameposition: relativeEvery elementposition: absoluteFrame overflowhiddenVectorsone svg layer on top
One frame, absolutely positioned children.

Pipeline

From convert to download

Convert builds thedocumentThe previewrenders in theframeThe downloadbutton startsdisabledA successfulconvert unlocks itClick savesfigma-frame.html
Convert builds the documentThe preview renders in the frameThe download button startsdisabledA successful convert unlocks itClick saves figma-frame.html
The download button waits for a result.

Pipeline

Everything runs locally

Parsing uses thebrowser DOMParserNo network callsanywhereDownload is alocal blob file
Parsing uses the browser DOMParserNo network calls anywhereDownload is a local blob file
The SVG never leaves the page.