Home › Developer Tools › SVG Viewer

SVG Viewer

Open an .svg file or paste SVG markup and see it rendered instantly. Edit the code with a live preview, zoom in on details, check it on light, dark or checkerboard backgrounds, and download it as SVG or PNG.

Last updated:

100%
Preview of your SVG
Advertisement
Advertisement

How to use the SVG Viewer

  1. Open or paste your SVG: click Open SVG file, drop a file onto the preview, or paste markup into the code editor.
  2. Watch the preview update as you type. Syntax errors are shown under the editor with the line number.
  3. Zoom and pan with the zoom buttons or slider; scroll the preview area to move around a zoomed image.
  4. Switch the background to the checkerboard to see transparent areas, or to dark to check light artwork.
  5. Download the edited file as .svg, or export a PNG at 1x, 2x or 4x of its natural size.

How SVG size works: width, height and viewBox

An SVG is a text file that describes shapes in XML. Two separate things control how big it looks. The viewBox attribute sets up the internal drawing grid as four numbers, min-x min-y width height: a shape at x="60" in a viewBox="0 0 120 120" sits exactly in the middle. The width and height attributes set the displayed size on the page. When both are present the grid is stretched to fit, keeping its aspect ratio by default (preserveAspectRatio="xMidYMid meet").

This viewer works out a natural size the same way browsers do: it uses width and height when they exist (converting units like pt, mm or in to CSS pixels), falls back to the viewBox size when they are missing, and uses the browser default of 300 × 150 when there is neither. A percentage width cannot be resolved without a container, so it is treated as missing.

Unit conversions used for SVG dimensions

UnitMeaningIn CSS pixels
px or no unitCSS pixel (user unit)1
ptPoint, 1/72 inch1.333
pcPica, 12 points16
inInch96
cmCentimeter37.795
mmMillimeter3.7795
emFont size (assumed 16px here)16

Quick fixes for SVGs that look wrong

  • Nothing shows: make sure the root tag has xmlns="http://www.w3.org/2000/svg" when the file is used as an image. This viewer adds it for the preview, but other programs may not.
  • Artwork is cut off: some shapes fall outside the viewBox. Widen the viewBox or move the shapes. Design tools sometimes export a viewBox that starts at negative coordinates, which is fine.
  • Icon will not scale with CSS: keep the viewBox and remove fixed width/height, then size it with CSS.
  • Fonts look different elsewhere: text uses whatever fonts the viewer has installed. Convert text to outlines in your editor for exact rendering.
  • Large file: editor metadata, long decimal numbers and hidden layers add weight. Run the file through an SVG optimizer before publishing.
  • Invalid XML: a bare & in text or an attribute must be written as &amp;, and every tag must be closed (<path … />).

Frequently asked questions

How do I open an SVG file online?

Click Open SVG file and choose the .svg from your device, or drag it onto the preview area. The file is read locally by your browser and never uploaded.

Why does my SVG show up blank?

Common causes are a missing xmlns="http://www.w3.org/2000/svg" attribute, shapes drawn outside the viewBox, white artwork on a white background, or fill set to none. Try the dark or checkerboard background and check the viewBox numbers shown in the info panel.

Does the viewer run JavaScript inside the SVG?

No. The preview is rendered as an image, and browsers never run scripts or load external resources inside SVGs displayed as images. That makes it safe to inspect files from unknown sources.

What is the difference between width/height and viewBox?

The viewBox defines the internal coordinate system (min-x, min-y, width, height) that shapes are drawn in. The width and height attributes set the displayed size. If width and height are missing, the viewBox size is used as the natural size.

Can I convert the SVG to PNG here?

Yes. Choose a scale (1x, 2x or 4x) and click Download PNG. The SVG is drawn on a canvas at that size, with a transparent background unless you pick a solid background color.

Why do external fonts or images not appear in the preview?

SVGs shown as images cannot load external files such as web fonts or linked images. Embed images as data URIs and convert text to paths for a file that looks the same everywhere.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

SVG OptimizerMinify SVG files: strip metadata, comments and editor junk, round numbers, compare sizes.SVG to PNGConvert SVG graphics to PNG or JPEG at any scale.SVG Path EditorEdit an SVG path d attribute visually: drag points, edit commands, convert, scale and minify.SVG to CSS Data URITurn SVG code into a small URL-encoded data URI for CSS backgrounds, with Base64 size comparison.Free Icon Search and DownloadSearch free open-source icons (Lucide, Tabler, Material), recolor, resize and get SVG or PNG.Online Image ViewerOpen HEIC, TIFF, PSD, RAW, AVIF, WebP, ICO and more in your browser with zoom, pixel inspector and EXIF.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.Open Graph PreviewPaste OG tags and preview how links look on Facebook, X and LinkedIn.YouTube Embed Code GeneratorCreate responsive YouTube embed code with start time, autoplay, loop and privacy mode.CSS Box Shadow GeneratorDesign layered CSS box shadows with a live preview, presets and one-click Copy CSS.CSS Border Radius GeneratorRound each corner, draw elliptical 8-value radii or random blob shapes and copy the CSS.CSS Button GeneratorDesign CSS buttons with gradients, borders, shadows and hover and active states, then copy the code.CSS Flexbox GeneratorBuild flexbox layouts visually: set container and item properties, then copy the CSS and HTML.Twitter Card GeneratorCreate X / Twitter Card meta tags with Open Graph fallbacks, character counters and a live preview.CSS Grid GeneratorDraw CSS grid layouts: set tracks and gaps, drag to name areas, then copy the CSS and HTML.PX to REM ConverterConvert px to rem or em and back, with a 1-100px table and a whole-CSS converter.Glassmorphism CSS GeneratorDesign frosted-glass UI cards with blur, transparency and border sliders, then copy the CSS.CSS Text Shadow GeneratorLayer CSS text shadows with a live preview and neon, 3D, outline and retro presets.HTML Editor (Live Preview)Write HTML, CSS and JavaScript and see a live, sandboxed preview as you type.HTML to JSX ConverterConvert HTML to valid React JSX: className, htmlFor, style objects, self-closing tags and events.CSS Clip-Path GeneratorDraw CSS clip-path shapes by dragging points: polygons, circle, ellipse and inset. Copy the CSS.CSS Animation GeneratorCreate CSS keyframe animations from 23 presets with live preview, timing controls and Copy CSS.CSS Triangle GeneratorMake CSS triangles in 8 directions with the border trick or clip-path. Set size and color, copy CSS.CSS Loader GeneratorPick from 14 pure CSS spinners and loaders, set color, size and speed, then copy the HTML and CSS.Cubic Bezier GeneratorDrag the control points to design a CSS easing curve, compare it with linear and copy cubic-bezier().CSS Filter GeneratorAdjust blur, brightness, contrast, hue, sepia and drop-shadow on an image and copy the CSS filter.CSS Specificity CalculatorCalculate CSS selector specificity (a, b, c), including :is(), :not(), :has() and :where(), and compare.Google Maps Embed GeneratorTurn an address or coordinates into responsive Google Maps iframe embed code, no API key.Neumorphism CSS GeneratorDesign soft UI neumorphic shapes with live preview and copy the box-shadow CSS.SVG Wave GeneratorMake layered SVG waves for section dividers and export SVG, PNG or a CSS background.SVG Blob GeneratorGenerate random organic SVG blob shapes with gradients and export SVG, PNG or CSS clip-path.CSS Clamp GeneratorTurn min/max sizes and viewport widths into a fluid CSS clamp() value in rem and vw.CSS @font-face GeneratorTurn font files or URLs into ready-to-paste @font-face rules with weights, styles and a preview.CSS Media Query GeneratorBuild @media rules for widths, orientation, dark mode and hover, or get framework breakpoints.CSS Scrollbar GeneratorStyle scrollbars: width, colors, radius and hover, with ::-webkit-scrollbar and scrollbar-color CSS.CSS Sprite GeneratorPack many icons into one sprite sheet PNG and get CSS classes with background-position.CSS Text Gradient GeneratorMake gradient text with background-clip:text: color stops, angle, font preview and fallback CSS.CSS Toggle Switch GeneratorDesign pure-CSS toggle switches: size, colors, shape and animation. Copy accessible HTML + CSS.CSS Tooltip GeneratorBuild pure CSS tooltips: position, arrow, colors, padding and animation. Copy HTML and CSS.HTML Form BuilderDrag and drop form fields with labels and validation, then copy accessible HTML and CSS code.Iframe GeneratorCreate iframe embed code: size or responsive ratio, border, allow, sandbox, lazy load, live preview.PX to VW ConverterConvert pixels to vw and vh for any viewport size, and vw/vh back to px, with breakpoint tables.SVG to JSXTurn SVG code into a clean React component: camelCase attributes, style objects, TypeScript.Tailwind CSS Cheat SheetSearchable Tailwind class to CSS reference with live previews, class decoder and color palette.Web App Manifest GeneratorCreate a PWA manifest.json and every app icon size from one image, downloaded as a ZIP.CSS Background Pattern GeneratorMake pure-CSS stripes, dots, checkerboard, zigzag and grid backgrounds and copy the code.CSS Color Filter GeneratorTurn a HEX color into a CSS filter that recolors black icons and SVGs, with an accuracy score.CSS Gradient Animation GeneratorCreate animated gradient backgrounds: pick colors, angle and speed, preview live and copy the CSS.CSS Hover Effects GeneratorPick button, link and image hover effects, tweak colors and timing, and copy the HTML and CSS.CSS InlinerMove CSS from style blocks into inline style attributes so HTML emails render in every client.CSS Shape Divider GeneratorCreate wave, tilt, curve and triangle section dividers and copy the SVG, HTML and CSS.CSS Transform GeneratorRotate, scale, skew and translate an element with sliders and copy the CSS transform code.Font Pairing ToolPreview Google Font heading and body pairs on real layouts and copy the embed code and CSS.HTML Accessibility CheckerPaste HTML to find WCAG accessibility problems with impact level, the failing element and a fix.HTML Image Map GeneratorDraw clickable rectangle, circle and polygon hotspots on an image and get image map HTML.Pathfinding VisualizerAnimate BFS, DFS, Dijkstra, A* and greedy search on a grid with walls, weights and mazes.
See all 52 Web, HTML & CSS Tools →