ForHosting KIT · Images

SVG to PNG

A logo built as SVG scales perfectly on a website but fails the moment it needs to sit inside an email client, a social media upload, or a system that simply doesn't parse vector markup. This endpoint renders that SVG into a PNG at whatever pixel size you specify, so the same artwork works both as crisp vector and as a pinned-down raster.

● StablePer request + per image$0.040
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The gap between vector and raster

SVG describes an image as math — paths, curves, fills — which is exactly why it looks sharp at any zoom level and why it's the right format for icons and logos on the web. But plenty of places downstream have no interest in math: email clients strip or mishandle embedded SVG, most social platforms want a fixed-size raster, and older document or print pipelines expect pixels, not markup. Rasterizing solves that mismatch without touching the original vector file.

How the rendering actually works

You send the SVG to /image/svg-to-png along with the output dimensions you want, and the service renders it at exactly that resolution rather than guessing. Because it renders from the vector source rather than upscaling an existing bitmap, a request for a 2000px export looks as clean as a 200px one — there's no interpolation blur, since every pixel is computed fresh from the underlying paths.

What to expect from the call

The request returns a task_id immediately, the rendering happens asynchronously, and you're notified through a signed webhook or retrieve the finished PNG from a signed link valid for 24 hours. This matters for SVGs with filters, gradients or embedded fonts, which can take a moment longer to render correctly than a simple flat icon.

A note on SVG's own history

SVG became a W3C standard in 2001, built specifically so vector graphics could live natively in web pages instead of relying on proprietary plugins. Ironically, that same universality is what makes it inconsistent to render outside a browser — different renderers interpret filters, fonts and complex effects slightly differently, which is exactly the kind of edge case a dedicated rendering task is built to handle consistently.

Where it fits into a workflow

Design systems, marketing automation tools and static-site generators all eventually need a raster export of something originally built as vector — an icon library exported to PNG for a mobile app, a logo dropped into a PDF, a badge sized for a specific ad unit. A single POST handles that step, retries automatically up to three times on failure, and never charges for a task that doesn't complete.

Email-safe logo rendering

A marketing tool converts a brand's SVG logo to PNG at a fixed pixel width before embedding it in HTML emails, avoiding client-side SVG rendering issues.

Icon library exports

A design system renders every icon in its SVG library to PNG at multiple resolutions for a mobile app that doesn't support vector assets natively.

Social media asset generation

A content team converts a vector badge or seal into a precisely sized PNG for a platform that only accepts raster uploads.

Print-ready exports

An e-commerce platform renders a vector product diagram to a high-resolution PNG for inclusion in a printed catalog.

How does the SVG to PNG API handle resolution?

You specify the output dimensions in the request, and the SVG is rendered fresh at that exact size, so large exports stay sharp instead of looking upscaled.

Is converting SVG to PNG free?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

What does it cost?

$0.040 per request plus $0.001 per image, and failed tasks are never charged.

Does it support SVGs with gradients, filters or embedded fonts?

Yes, the renderer processes standard SVG features including gradients and filters; embedding fonts directly in the SVG gives the most predictable text rendering.

Is the conversion synchronous?

No, it's asynchronous. You get a task_id immediately, and the PNG arrives via signed webhook or a signed link valid for 24 hours.

Can I generate multiple resolutions from the same SVG?

Yes, send a separate request for each size you need; each request renders from the original vector source, not from a previous raster output.

What happens if the SVG file is invalid?

The task retries automatically up to three times, and if the file still can't be rendered you get a clear error with no charge.

Is there a limit on output size?

You set the dimensions per request; extremely large outputs simply take a bit longer to render since every pixel is computed from the vector paths.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/image/svg-to-png

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/image/svg-to-png \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image":"https://ejemplo.com/imagen.jpg"}'
{
  "image": "https://ejemplo.com/imagen.jpg"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "image.svg_to_png",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.040
Per image$0.001

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb15
max_megapixels12
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
422task_failedThe task failed after 3 retries. You are never charged for it.

Read the full KIT documentation →