HTML to SVG Converter

Save an HTML page as an SVG that wraps a picture of it, 1280 px wide.

or drop files here

HT

HTML Format

HyperText Markup Language

The standard markup language for web pages, maintained by the WHATWG as the HTML Living Standard. It describes the structure of a page with elements and attributes.

  • text-based markup
  • elements and attributes
  • styled with CSS
  • rendered by every browser
SV

SVG Format

Scalable Vector Graphics

An XML-based vector image format and W3C standard. Shapes, paths and text are described mathematically, so images scale to any size without losing sharpness.

  • resolution independent
  • XML text
  • supports animation and scripting
  • styleable with CSS

How to convert HTML to SVG

Follow these steps to convert HTML to SVG online.

    1

    Choose your HTML file, or several at once.

    2

    Wait while the converter turns each file into SVG.

    3

    Download each new SVG file. Your original file isn't changed.

Related Tools

SVG to HTML

Convert SVG to HTML format

HTML to CSV

Convert HTML to CSV online

HTML to GIF

Convert HTML to GIF: a picture of the page, 1280 px wide. External images and stylesheets aren't loaded, and scripts don't run.

HTML to Markdown

Convert HTML to Markdown online — fast, private, and in your browser.

HTML to WebP

Convert HTML to WebP: a picture of the page, 1280 px wide. External images and stylesheets aren't loaded, and scripts don't run.

ARW to SVG

Convert ARW images to SVG format

BMP to SVG

Convert BMP files to SVG format

CDR to SVG

Convert CDR to SVG format

CR3 to SVG

Convert CR3 images to SVG format

CUR to SVG

Convert CUR images to SVG format

DNG to SVG

Convert DNG images to SVG format

DOCX to SVG

Convert DOCX to SVG: an SVG of each page of your Word document. Each holds a picture of the page, so its text isn't editable.

DST to SVG

Convert DST to SVG format

GIF to SVG

Convert GIF files to SVG format

HEIC to SVG

Convert HEIC files to SVG format

JPG to SVG

Convert JPG to vector SVG

ORF to SVG

Convert ORF to SVG format

OTF to SVG

Convert OTF to SVG: an SVG holding a specimen picture of the font (its name, letters, digits and a sample sentence), not its glyph outlines.

PES to SVG

Convert PES to SVG format

PNG to SVG

Convert PNG files to SVG format

RAF to SVG

Convert RAF to SVG format

SVG to SVG

Convert SVG images to SVG format

TTF to SVG

Convert TTF to SVG: an SVG holding a specimen picture of the font (its name, letters, digits and a sample sentence), not its glyph outlines.

WebP to SVG

Convert WebP files to SVG format

What to know before converting HTML to SVG

  • The SVG holds one embedded PNG of the page, not editable text or shapes.
  • The page is laid out 1280 px wide and cut at 4096 px tall.
  • Scripts, frames and linked stylesheets are removed; nothing is fetched.
  • Pictures and fonts show only when embedded in the file as data: URLs.
  • Each HTML file you choose gives its own SVG.

Understanding HTML for SVG output

What is an HTML file?

HTML, short for HyperText Markup Language, describes web pages and web applications. The early versions came out of CERN and, later, the IETF (1990 to 1995). Today the WHATWG keeps HTML as a Living Standard. An HTML file says what each part of a page is: a heading, a paragraph, a link, a picture. Appearance comes from CSS, and JavaScript adds behavior.

An HTML file can link to separate files instead of holding every asset itself, so a saved page may depend on pictures, fonts, stylesheets and scripts that stay on the website. Its registered media type is text/html.

Programs that open HTML files

  • Windows, Mac and Linux: Firefox renders a local HTML file; open one with Ctrl+O or Command+O.
  • Windows, Mac and Linux: Visual Studio Code is an editor with syntax highlighting, completion and formatting for HTML.

A text editor shows the markup itself, which is what you check when a picture or style link looks wrong. A browser shows the finished page, which is what this converter draws.

HTML and SVG compared

  • Extensions and media types: .html goes with text/html; .svg goes with image/svg+xml, and gzip-compressing an SVG gives .svgz.
  • What they hold: HTML describes a document that a browser lays out. SVG is an XML language that describes two-dimensional graphics as shapes, text and embedded images.
  • Readable as text: an SVG is plain text, which any editor opens and ordinary tools can search, index or compress. In the SVG this page makes, the words are pixels, not text.
  • Standards: HTML is a WHATWG Living Standard. SVG is a W3C standard: version 1.0 reached Recommendation status in 2001, and 1.1 followed in 2003.
  • Scripting and style: both work with CSS and JavaScript, and an SVG can be styled, scripted and animated. This converter's SVG has nothing to animate.
  • Where they show: major browsers render SVG as a page of its own or inline within HTML.

This converter doesn't turn HTML into drawing shapes. It parses the file without running it, lays the page out 1280 px wide, and draws it to a picture. The picture is wrapped in an SVG as one embedded PNG at the page's pixel size. Height follows the page, up to 4096 px, where a longer page is cut off. The vh unit uses an 800 px window. The HTML stays as it was; the download is a fresh file with the same name, for example report.svg.

Scripts, frames, objects, event attributes, <base>, <link> and <meta http-equiv> elements and audio are removed, and nothing is fetched from any site. A video shows only its poster frame, if the file defines one. Inline styles and <style> blocks apply. Pictures and fonts apply only when they're included in the file as data: URLs.

Other ways to convert HTML to SVG

  • Inkscape: take a full-page screenshot of the page, then choose File > Import in Inkscape and pick it. A dialog asks whether to link or embed the image; embedding stores it inside the SVG file, and linking breaks if the screenshot moves. The SVG still holds a picture.
  • modern-screenshot: the library behind this page lists domToSvg among its functions. It runs inside a web page you control.
  • XMLSerializer: when the HTML already contains an inline <svg>, new XMLSerializer().serializeToString(document.querySelector('svg')) returns its markup as a string. It extracts existing artwork only; it doesn't convert the rest of the page.

Problems with HTML files

  • Pictures or styling are missing: a saved page links to files that stayed online, and without them it loses its pictures and styling. Save the page with its files, or embed them in the HTML, and convert again.
  • The text looks garbled: the character encoding is wrong or undeclared. HTML defines encoding declarations, so declare it in the file.
  • The SVG ends early: your page is taller than the converter's height limit. Break the HTML into shorter parts and convert each.
  • The page looks different here: linked fonts and stylesheets aren't loaded. Put the CSS inline and put the fonts in the file.
  • An editor shows no errors in linked files: Visual Studio Code limits its built-in HTML analysis to the current file, so it doesn't inspect linked scripts and styles.

Frequently Asked Questions

Everything you need to know about our converter

How do I convert HTML to SVG?

Is the text in the SVG editable?

Why are the pictures in my HTML missing from the SVG?

Does the converter run the JavaScript in my HTML?

How wide is the page in the SVG?

Why does my long HTML page end partway down?

Is my separate CSS file applied?

Is there a way to get real vector shapes from HTML?

Why do the fonts look different from the website?

Does enlarging the SVG make it blurry?