View, check and edit SVG

SVG Viewer

Open SVG files or code, zoom in, see why one looks wrong, and edit the code with a live preview.

Last updated: November 2026

Files or code

Open or paste

Live editor

Code and preview

7 outputs

SVG to React

Private

No uploads

Drop SVG files here

Or paste SVG code anywhere on this page

Your files never leave this device

How to view an SVG file online

01

Open your SVG

Drop SVG files, choose them, or paste SVG code anywhere on the page. Start from code opens the editor with an example.

02

Look closely

Scroll to zoom, drag to move, and switch the background to see transparent and white parts.

03

Read the info

See its size, viewBox, colors and fonts, and checks that explain anything that may look wrong elsewhere.

04

Edit and save

Change the code and watch the preview follow, then save it as SVG, PNG or JPG, or copy it for your code.

What the viewer tells you about an SVG

The Info tab lists the width and height written in the file, the viewBox and the shape it gives, the size the SVG shows at, the file size and how many elements it has. Colors are gathered from attributes, inline styles and <style> blocks, with named, hex and rgb colors counted as one; click a color to copy its hex code. Fonts are listed with whether they're embedded.

The Checks list explains what may make the SVG look different somewhere else, and what the viewer removed for safety.

Why an SVG looks wrong: the checks

  • No viewBox

    Without a viewBox no scaling is applied, so an SVG resized in a page or app gets cropped or leaves empty space instead of growing or shrinking. W3C SVG 2

  • A viewBox of zero width or height

    A viewBox width or height of zero or less disables rendering: nothing is drawn. MDN

  • Missing xmlns

    A standalone .svg file needs the SVG namespace. Without it, browsers show the code or an error instead of the picture. Inside an HTML page it isn't needed. MDN

  • Fonts that aren't embedded

    A font is used only where it is installed or can be loaded. An SVG shown as an image loads no outside fonts, so text falls back to another font. MDN

  • Colors in a <style> block

    A fill set in CSS wins over a fill attribute, so editing fill attributes alone won't recolor those shapes. MDN

  • Shapes with no fill

    Shapes without a fill are painted black, which disappears on a black background. MDN

Edit SVG code with a live preview

The Code tab is a full code editor with highlighting, line numbers, search, tag completion and undo, built on CodeMirror. Change a color, a size or a path, and the preview follows as you type. If the code stops being a valid SVG midway, the preview keeps the last version that worked.

Format lays the code out with indentation without changing the drawing. Minify makes the file smaller with SVGO, the standard SVG optimizer. For the full set of optimizer options, use the SVG Optimizer.

Save and copy

  • SVGThe file itself, as you edited it.
  • Data URIFor src and url() in HTML and CSS, percent-encoded.
  • Base64 data URIThe same as Base64, for tools that need it.
  • CSS backgroundA ready rule with background-image and sizing.
  • JSXThe SVG with React's attribute names, to paste into a component.
  • React componentA component that passes its props to the <svg>.
  • PNG and JPGAt 1x to 8x of the SVG's own size; JPG on white.

For many SVGs at exact pixel sizes, use SVG to PNG or SVG to JPG. For data URI options such as CSS masks, use SVG to Data URI. To make an SVG from a photo or logo, use Image to SVG.

Safe to open any SVG

An SVG is code, and it can carry scripts, embedded web pages and links to other servers. In this viewer they never run: the SVG is shown as an image, where browsers run no scripts and load nothing from elsewhere (W3C SVG 2, MDN). The viewer also removes them before showing, saving or copying, and lists what it removed and why, so the files you save are clean too.

Nothing is uploaded: your SVGs are read and shown in your browser, and stay on your device.

Why use ImgTweak?

✓Files and code, many at once
✓Checks that explain what looks wrong
✓Live code editor, format and minify
✓Copy as data URI, CSS, JSX or React
✓Scripts never run; nothing uploaded
✓No sign-up, no watermark

Frequently asked questions

How do I open an SVG file online?

Drop it on the box above or choose it. It opens in the viewer at once, with zoom, backgrounds and its details. Several SVGs can be open together.

How do I view SVG code as an image?

Paste the code anywhere on this page, or choose Start from code and paste it into the editor. The picture shows next to the code and follows every change.

Why is my SVG blank or invisible?

Common causes: white shapes on a white background (switch the background to black or the checkerboard), a viewBox with zero width or height, a missing xmlns when the file is opened on its own, or shapes outside the viewBox. The Checks list points to the first three.

Why does the text in my SVG look different?

Text uses the font named in the file only where that font is installed. When an SVG is shown as an image, as here, fonts from the web or the computer aren't loaded, so another font is used unless the font is embedded in the SVG.

What is a viewBox?

Four numbers that set which area of the drawing is shown and let it scale. Without a viewBox, an SVG doesn't resize: shown bigger or smaller, it gets cropped or leaves empty space.

Is it safe to open an SVG here?

Yes. An SVG file can contain scripts, but scripts never run in an image, and the viewer also removes them, along with links to other servers, before showing or saving the file. It tells you what it removed.

Are my files uploaded?

No. Everything runs in your browser. Your SVGs never leave your device.

Can I edit the SVG code?

Yes. The Code tab has an editor with highlighting, search and undo. Format lays the code out neatly without changing the drawing; Minify makes the file smaller.

How do I convert SVG code to PNG?

Open or paste the SVG, pick a size (1x to 8x), and select Save PNG. Save JPG fills transparent areas with white. For many files or exact pixel sizes, use SVG to PNG.

Can I copy an SVG as JSX or a React component?

Yes. Choose JSX or React component in the Copy list. Attributes get React's names (className, strokeWidth) and styles become objects.

Open an SVG

Drop a file above, or paste SVG code anywhere on the page.