Skip to content

SVG to JPG Converter

Convert a safe, self-contained SVG into an opaque JPG locally with explicit size and quality controls.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Choose a self-contained .svg file no larger than 5 MiB and wait for its safety and dimension checks.
  2. 2.Select an opaque background color and JPEG quality; changing either clears an older result.
  3. 3.Convert the SVG, compare the JPG preview with the source, and download the new raster file.

About SVG to JPG Converter

SVG to JPG Converter turns a self-contained vector file into an opaque JPEG image in the current browser. Choose an .svg file, review the detected pixel dimensions, select a JPEG quality from 0.60 through 1.00, and choose the solid background color that should replace transparency. The browser decodes the accepted SVG, draws it at its declared size on a canvas, fills the canvas before drawing, and exports a separate .jpg download. The SVG text, rendered pixels, filename, and JPG are not uploaded to Lizely.

JPG has no alpha channel, so transparent SVG regions cannot remain transparent. This tool always paints an opaque background first; white is the default, and the color control can provide another solid color. Shapes then render above that background in their original order. Quality controls JPEG compression, not output dimensions. A higher value generally preserves more detail and creates a larger file, while a lower value can add visible artifacts around sharp vector edges, small lettering, gradients, and high-contrast boundaries. The result is a raster image and cannot preserve infinitely scalable paths or editable SVG objects.

Output dimensions come from explicit positive root width and height values expressed as unitless CSS pixels or px values. If either usable dimension is missing, the converter uses the positive width and height from viewBox. It does not guess a size for percentage dimensions, physical units, an absent viewBox, or invalid values. Fractional dimensions are rounded to whole canvas pixels. A side may be at most 8,192 pixels, the total output may be at most 32,000,000 pixels, and an input file may be at most 5 MiB. Files over these limits receive an error; they are never silently resized, partially read, or truncated.

SVG can contain active or network-connected features, so this converter deliberately accepts a smaller subset than a full browser SVG renderer. Before image decoding, shared audit logic rejects script, foreignObject, iframe, object, embed, image, audio, video, and style elements. It rejects event-handler attributes, inline style attributes, xml:base, document type and entity declarations, non-XML processing instructions, and links or resource attributes that are not local fragment references. CSS url() references are accepted only for local fragments such as url(#gradient). A second DOM-based check verifies well-formed XML, an SVG root in the SVG namespace, banned elements, and unsafe attributes.

The conservative style restriction means some ordinary SVGs exported by design software will be refused even when their style block is harmless. Convert those files by asking the authoring application to expand appearance into presentation attributes and paths, remove embedded images, remove scripts and event handlers, and package gradients, masks, clips, and filters inside the same SVG with fragment IDs. This tool does not fetch remote images, web fonts, stylesheets, linked SVG files, or data-URL images. It does not sanitize unsafe content and then continue; it stops and explains the unsupported surface so the user can inspect the source.

Passing the text audit does not guarantee that every SVG feature can be rendered by every browser. Font availability, filter implementations, color management, masks, clipping, and SVG version support can differ. The current browser must successfully parse and decode the file before canvas drawing. A malformed file or unsupported feature produces a decode error and clears any previous download. Canvas export can also return no blob or throw; those failures are reported rather than leaving an old successful JPG visible. Choose a current browser and compare the preview with the authoritative vector source.

Source and result files use separate temporary object URLs. Selecting another file revokes both old URLs, changing quality or background revokes the old JPG, generating again replaces the result URL, and leaving the page releases every remaining URL. Request and mounted-state guards prevent a slow decode or canvas export from replacing newer settings. The same file can be selected again because the hidden file input is reset after each choice. These lifecycle rules keep stale previews from being mistaken for the current conversion and avoid retaining large local blobs longer than needed.

Use this converter for ordinary web graphics, simple diagrams, logos made from local paths, self-contained icons, and other trusted artwork that fits the documented subset. Do not use it as a general-purpose sanitizer for hostile SVGs or as proof that an SVG is safe to publish elsewhere. It does not preserve vectors, metadata, embedded fonts, animation, interactivity, accessibility structure, links, layers, or source editing history in the JPG. For archival, print, color-critical, or untrusted-content workflows, use a maintained desktop conversion tool or isolated server pipeline with a documented SVG security policy and inspect the output before distribution.

Methodology & sources

The browser validates the SVG filename or MIME type and 5 MiB limit, reads text, runs a conservative shared audit for scripts, animation, style surfaces, CSS obfuscation, external content, and alternate-prefix resource attributes, derives integer bitmap dimensions from positive pixel width and height or viewBox, and confirms well-formed namespaced SVG with DOMParser. It fills a bounded canvas with the selected background, draws the decoded SVG, requests image/jpeg from canvas.toBlob at quality 0.60-1.00, and verifies the returned Blob is JPEG. Stale work and object URLs are invalidated on replacement, setting changes, errors, and unmount.

Frequently asked questions

Why was an ordinary SVG rejected?
The tool uses a conservative subset and rejects style blocks or attributes, embedded images, scripts, animation elements, CSS escape or comment obfuscation, foreignObject, event handlers, and external resources even when a particular file might use them harmlessly.
What happens to transparent SVG areas?
JPEG has no alpha channel. The complete canvas is filled with the selected solid background before the SVG is drawn.
How is the JPG size chosen?
Positive root width and height in pixels are used first; otherwise positive viewBox dimensions are used. Unsupported or missing dimensions are rejected instead of guessed.
Does the tool load remote images or fonts?
No. Image elements, style surfaces, non-fragment href or src values, and non-fragment CSS url() references are rejected before decoding.
Are my files uploaded?
No. File reading, auditing, SVG decoding, canvas drawing, JPEG export, preview, and download happen locally in the current browser.

Image Tools guides

View all