Wrap your HTML and inline CSS inside a scalable SVG using foreignObject. Preview it live, then download it as .svg, PNG or JPG. Everything runs in your browser.
Paste or type HTML with inline CSS, or drop an .html file here. The preview updates as you type.
HTML to SVG puts your HTML and CSS inside an SVG file with a foreignObject element, so text stays text and shapes stay sharp when enlarged. Type or paste markup, open an HTML file or start from a template, and the preview updates as you type. Set the width, let the height fit the content, then save an SVG, or a PNG or JPEG at 1×, 2× or 3×. The SVG displays in web browsers, not in most design apps. It is free and runs in your browser.
The same card saved as a 1× PNG and as an SVG, both enlarged. Drag the line to compare.

PNGSVG
Type or paste HTML with inline CSS or a style block, open an HTML file, or start from the Card, Badge or Quote template. The preview shows the SVG as you type.
Enter the width in pixels, from 1 to 10000. With Fit the height to the content ticked, the height follows your markup; untick it to type your own height.
Choose SVG, PNG or JPEG under Save as and press Save Image, or press Copy SVG Code to paste the SVG into a web page.
Images, web fonts and stylesheets your markup links with a full http or https address are downloaded and written into the SVG, so the file works on its own. If a site does not let other sites read its files, the tool says how many could not be embedded.
What your markup leaves unpainted stays transparent in the SVG and the PNG, so the graphic sits on any background. JPEG has no transparency, so those areas turn white.
A higher scale gives a sharper picture on high-resolution screens: a card 400 pixels wide saves 800 or 1200 pixels wide. Pictures are kept to 16 megapixels and 16384 pixels a side, the most browsers can draw, and the status line says when that happens.
| Input | HTML and CSS, typed, pasted or opened from an HTML or text file |
|---|---|
| Size | Width 1 to 10000 px; the height fits the content or is set by hand |
| Saves as | SVG, or PNG and JPEG at 1×, 2× or 3× |
| Where the SVG shows | Web browsers, in a page, an img tag or a tab; most design apps do not draw foreignObject |
| Scripts | Taken out: script elements, on* event attributes and javascript: links |
| Price | Free, with no watermark and no sign-up |
| Where it runs | In your browser; nothing is uploaded |
Updated November 25, 2026
Your markup is rewritten as well-formed XHTML and placed inside an SVG foreignObject element, which web browsers draw like a small web page. Text stays text and CSS keeps styling it, so both stay sharp when the SVG is enlarged; a photo inside it is still made of pixels.
Because they do not draw foreignObject. Web browsers do, so the SVG works in a web page, in an img tag and opened in a browser tab. Most design apps and many image converters show it empty. For those, save a PNG or JPEG instead.
Yes, when they are linked with a full http or https address: an img src, a CSS url() and a linked stylesheet are downloaded and written into the file. Relative addresses are not fetched, and a site that does not let other sites read its files cannot be embedded; the tool tells you when that happens.
No. Write ordinary HTML: a br tag without a closing slash or an entity such as is fine. An SVG file must be well-formed XML, so the tool rewrites your markup as XHTML before it builds the file.
No. Script elements, event attributes such as onclick and javascript: links are removed before the SVG is built, so the saved file cannot run them. The preview is shown as an image, which never runs scripts either.
Yes. Choose PNG or JPEG under Save as, and 1×, 2× or 3× for a sharper image. PNG keeps transparent areas transparent; JPEG fills them with white. Unlike the SVG, a PNG or JPEG is a fixed grid of pixels and blurs if it is enlarged later.
No. The SVG is made entirely in your browser. The only requests are for the images, fonts and stylesheets your markup links to, which are fetched from the sites that host them.
Yes. The preview sits above the code box, so you see the result as you type. Saving downloads the file, or offers Share where the phone can share files.