Skip to content
TL ToolLab

Image Tools

SVG to PNG Converter

Convert SVG files to PNG images online. Set custom width, height, and background color. Download high-resolution PNG instantly.

{ this.svgCode = ev.target.result; }; r.readAsText(f); }, async convert() { if(!this.svgCode.trim()) return; const s = parseFloat(this.scale)||1; const w = this.width * s, h = this.height * s; const blob = new Blob([this.svgCode], {type:'image/svg+xml'}); const url = URL.createObjectURL(blob); const img = new Image(); img.onload = () => { const canvas = document.createElement('canvas'); canvas.width = w; canvas.height = h; const ctx = canvas.getContext('2d'); if(!this.transparent) { ctx.fillStyle = this.bgColor; ctx.fillRect(0,0,w,h); } ctx.drawImage(img, 0, 0, w, h); URL.revokeObjectURL(url); this.preview = canvas.toDataURL('image/png'); }; img.src = url; }, download() { if(!this.preview) return; const a = document.createElement('a'); a.href = this.preview; a.download = this.filename; a.click(); } }">

SVG Input

Detected size: → Output:

Preview & Download