SVG to PNG Comes Out Blank or Missing Text
Six reasons an SVG rasterises to an empty or partly empty PNG — missing viewBox, transparent-on-transparent, external fonts and images, unsupported filters, and CSS the converter strips. Each with the fix.
An SVG that looks perfect in the browser produces a blank PNG. Or the shapes come through but the text is gone. Or half the icon is missing.
These are all rendering failures, not conversion failures. The SVG itself is fine — the rasteriser is working from a different set of assumptions than your browser.
1. No viewBox
The most common cause of “blank”.
An SVG needs either width/height attributes, or a viewBox, or both:
<svg viewBox="0 0 24 24"> <!-- renders -->
<svg width="24" height="24"> <!-- renders -->
<svg> <!-- 0×0 canvas → blank output -->
With neither, the renderer has no idea what region to draw, so it draws nothing — and a 0×0 PNG looks exactly like a blank one.
Fix: add viewBox="0 0 <width> <height>". If the file came from a design tool, this is usually an export option you turned off.
2. White content on a transparent background
If the artwork is white fills and the PNG has an alpha channel, the file is technically correct — and looks completely blank against a white viewer background.
Open the PNG on a dark background (or in a viewer with a checkerboard) before concluding it failed. Half of “blank PNG” reports are this.
Fix: set an explicit background colour in the converter, or open it somewhere that shows transparency.
3. Text that depends on an external font
Text renders only if the font is available. Three separate failure modes:
- The SVG names a font that isn’t installed (
font-family="Inter"with no Inter on the machine) - The SVG relies on a
@font-facein an external stylesheet the rasteriser never loads - The font is embedded as a reference, not as data
Browsers fall back to a default font and you see something. Many rasterisers render nothing at all.
Fix: convert text to paths (outlines) before export. Every design tool has this option and it’s the only reliable answer for a file that must render identically everywhere.
4. External images and <use href="...">
Any reference that points outside the SVG file — an <image href="photo.png">, a <use href="icons.svg#star"> — needs to be fetched. In a sandboxed converter those fetches either fail silently or are blocked.
Result: everything renders except the referenced pieces.
Fix: inline the references. Embed images as base64 data URIs, and inline the symbol definitions directly into the file.
5. Filters, masks and blend modes
<filter> with feGaussianBlur, <mask>, <clipPath> with complex geometry, and mix-blend-mode are unevenly supported by rasterisers. Browsers implement the full spec; a lightweight converter often implements a subset.
Typical symptom: the drop shadow is gone, or the masked area became fully transparent (a hole where content should be).
Fix: flatten filters and masks in the design tool before exporting, or render in a full browser engine.
6. CSS the converter strips
Many SVG files carry <style> blocks or style="..." attributes with classes, CSS variables (var(--brand)), or currentColor.
var()resolves to nothing outside a document with those variables defined → the property is droppedcurrentColorneeds an inheritedcolor→ falls back to black or nothing- External stylesheets are never loaded
Fix: inline the resolved values. Replace var(--brand) with the actual hex, currentColor with a concrete colour.
Quick diagnostic order
Work down this list — it resolves most cases in the first two steps:
- Open the SVG in a browser. Renders fine? The file is valid, the rasteriser is the problem.
- Check for
viewBox. Missing? That’s it. - Check the PNG on a dark background. Is it actually blank, or just white-on-transparent?
- Does it contain text? If the text is missing but shapes are fine, it’s a font issue — outline the text.
- Does it reference anything external? Inline it.
- Does it use filters or masks? Flatten them.
A note on what “correct” means here
An SVG is a document, not an image. It can reference fonts, other files, and CSS. A PNG is a fixed grid of pixels with no references at all.
So conversion is not a format swap — it’s a render, and a render needs everything the document depends on. Files that render everywhere are the ones with no external dependencies: paths instead of text, data URIs instead of links, resolved values instead of variables.
Try it: SVG to PNG — rendered in your browser, so fonts and styles resolve the way they do in a browser. Nothing is uploaded.
Related: why a “redacted” screenshot still leaks text, compress an image to an exact file size