Skip to content
⚠ TESTING ENVIRONMENT You are viewing a testing copy of Tolioo. Changes here do not affect the live website.

SVG Code Generator

Design shapes, stars and text visually and get clean SVG code instantly. Copy it or download it as SVG or PNG. Fast, free and no signup.

  • 100% free
  • No Signup
  • SVG, CSS and Base64

Canvas

Background

Add a shape

Layers (top of the list is drawn last)

    Edit shape

    Create SVG code in 3 simple steps

    1. 1

      Add shapes

      Pick a rectangle, circle, star, polygon, line, text or path.

    2. 2

      Style them

      Change size, position, colors, stroke, opacity and rotation.

    3. 3

      Copy or download

      Copy the SVG code, CSS or Base64, or save an SVG or PNG file.

    SVG CODE GENERATOR GUIDE

    Free SVG Code Generator – Create SVG Shapes and Copy Clean SVG Code Online

    An SVG code generator lets you design vector graphics visually and get the finished SVG code without writing a single tag by hand. This free online SVG generator helps you create rectangles, circles, ellipses, lines, regular polygons, stars, text and custom paths, then adjust the size, position, fill color, stroke, opacity and rotation of every shape while a live preview updates instantly. When your design is ready, copy the clean SVG code, grab it as a CSS background data URI or a Base64 string, or download it as an SVG file or a high-resolution PNG. Because SVG stands for Scalable Vector Graphics, the image stays perfectly sharp at any size, from a tiny 24 pixel icon to a full-width hero banner, and the files are usually much smaller than PNG or JPG images. Web developers use an SVG maker to build icons, logos, badges, shapes, dividers, placeholders and decorative backgrounds, designers use it to prototype quick vector shapes, and bloggers and marketers use it to create lightweight graphics that load fast and help pages score better on speed. You can start from a size preset such as an icon, a standard canvas or a social media image, stack as many layers as you need, reorder them with one click and minify the output for production. Everything runs in your browser, so your design is never uploaded or stored, and there is no signup, no watermark and no limit on how many SVG files you can create.

    Whether you need a simple icon, a logo placeholder, a badge, a divider or a social image background, this free online SVG maker gives you clean code without opening a design program. Pick a canvas size, add shapes, style them with colors and strokes, then copy the SVG, CSS or Base64 code or download an SVG or PNG file. It runs in your browser on Windows, Mac, Linux, Android and iPhone, needs no signup and never uploads your design.

    Visual SVG Shape Maker

    Add shapes, drag the numbers and colors, and see the result live. Get valid SVG markup without learning the syntax first.

    SVG, CSS and Base64 Output

    Copy plain SVG code, a ready CSS background-image data URI, or a Base64 string for embedding in HTML, CSS or JavaScript.

    Download SVG or PNG

    Save a crisp SVG file for the web, or export a PNG at 1x, 2x or 3x when you need a regular image.

    What Is SVG?

    SVG (Scalable Vector Graphics) is an XML-based image format that describes shapes with code instead of pixels. Because a browser draws the shapes mathematically, an SVG never gets blurry when it is scaled, and it can be styled with CSS, animated and even changed with JavaScript. SVG is supported in all modern browsers and can be used inline in HTML, as an image file or as a CSS background.

    SVG vs PNG vs JPG: Which Should You Use?

    FeatureSVGPNGJPG
    TypeVector (shapes)Raster (pixels)Raster (pixels)
    Scales without blurYesNoNo
    Best forIcons, logos, shapes, diagramsScreenshots, graphics with transparencyPhotographs
    TransparencyYesYesNo
    Editable with code or CSSYesNoNo

    Supported SVG Shapes and Elements

    ShapeSVG elementMain attributes
    Rectangle<rect>x, y, width, height, rx
    Circle<circle>cx, cy, r
    Ellipse<ellipse>cx, cy, rx, ry
    Line<line>x1, y1, x2, y2, stroke
    Polygon and star<polygon>points
    Text<text>x, y, font-size, font-family, text-anchor
    Custom path<path>d

    How to Create SVG Code Online

    1. Set the canvas: Choose a size preset or enter a custom width and height, and pick a background color or transparent.
    2. Add shapes: Click a shape button. Each new shape appears in the layers list and in the preview.
    3. Edit the details: Select a layer and change its position, size, colors, stroke, opacity and rotation.
    4. Arrange the layers: Move shapes up or down, duplicate them or delete the ones you do not need.
    5. Export: Copy the SVG, CSS or Base64 code, or download the SVG or PNG file.

    A Simple SVG Code Example

    This is what a basic SVG with a rounded rectangle and a circle looks like:

    <svg xmlns="http://www.w3.org/2000/svg" width="200" height="120" viewBox="0 0 200 120">
      <rect x="10" y="10" width="180" height="100" rx="12" fill="#eef2ff" stroke="#4f46e5" stroke-width="3"/>
      <circle cx="100" cy="60" r="30" fill="#4f46e5"/>
    </svg>

    How to Use SVG Code on Your Website

    • Inline SVG: Paste the code straight into your HTML. You can style it with CSS and change it with JavaScript.
    • Image file: Save the SVG file and use it in an <img> tag, like any other image.
    • CSS background: Use the CSS tab to copy a background-image data URI, which saves an extra file request.
    • Base64: Use the Base64 tab when you need the image as a text string in code or an email template.

    Tips for Clean, Fast SVG Files

    • Keep a viewBox: The viewBox lets the SVG scale to any size while keeping its proportions.
    • Minify for production: Tick the minify option to remove spaces and line breaks.
    • Use few shapes: Simple shapes keep the file small and the page fast.
    • Add accessibility text: For meaningful graphics, add a title element or an alt attribute on the image.

    SVG Canvas Size Presets

    Start from a preset and change it later, or enter your own width and height. The viewBox is set for you, so the graphic scales cleanly.

    Canvas presets in the SVG code generator
    PresetSizeGood for
    Icon24 x 24 or 64 x 64UI icons, buttons and small symbols
    Square100 x 100Avatars, badges and simple logos
    Standard400 x 300Illustrations and diagrams
    Large800 x 600Hero graphics and detailed artwork
    Social1200 x 630Link preview and social sharing images (export as PNG)

    Where to Use SVG Code

    • Website icons and logos: SVG stays sharp on every screen, including high-density phones and large monitors.
    • Buttons, badges and dividers: Small shapes cost only a few bytes and can be styled with CSS.
    • CSS backgrounds: Use the data URI from the CSS tab as a background-image without an extra file request.
    • Email and app templates: Use the Base64 output when you need the graphic as a text string.
    • Presentations and documents: Download a PNG at 2x or 3x when a tool does not accept SVG files.

    Troubleshooting: Common SVG Problems

    • The SVG does not show in the browser: Make sure the code starts with an svg tag that includes xmlns="http://www.w3.org/2000/svg", and that every tag is closed.
    • The graphic is cropped or too small: Check the viewBox. It should match the width and height of the canvas.
    • The PNG looks blurry: Export at 2x or 3x. A PNG is made of pixels, so a larger export keeps edges sharp.
    • Colors look different in an email: Many email clients block or change inline SVG. Export a PNG for emails.
    • The file is larger than expected: Use fewer shapes, avoid long paths and turn on Minify SVG code.

    SVG Code Generator on Mobile, Windows and Mac

    The SVG maker works in any modern browser, so you can design on a phone, tablet or computer. Add shapes with a tap or a click, copy the code into your project, or download the SVG or PNG file to your device.

    Is It Safe to Create SVG Online?

    Your design is created inside your browser and is not uploaded, saved or shared by this tool. If you paste SVG code from an unknown source into your own website, review it first, because SVG files can contain scripts.

    More Free Developer Tools You May Need

    SVG work often touches images, colors and markup. These free tools can help:

    COMMON QUESTIONS

    Frequently Asked Questions About SVG Code

    Find answers to common questions about creating SVG code online.

    What is an SVG code generator?

    An SVG code generator is a tool that lets you design vector shapes visually and gives you the SVG code for them. You choose shapes, colors and sizes, and the tool writes the markup for you.

    Is this SVG generator free to use?

    Yes. It is free with no signup, no watermark and no limit on the number of SVG files you can create.

    How do I use SVG code in HTML or CSS?

    Paste the SVG code directly into your HTML to use it inline, or save it as a file and load it with an image tag. For CSS, copy the data URI from the CSS tab and use it as a background-image value.

    Can I download my design as a PNG image?

    Yes. Use Download PNG and choose 1x, 2x or 3x to get a sharper image. You can also download the original SVG file.

    Which shapes can I create?

    You can create rectangles, circles, ellipses, lines, regular polygons, stars, text and custom paths. Each shape can have its own fill, stroke, opacity and rotation.

    Is my design uploaded or stored anywhere?

    No. Everything is created in your browser, so your design and code are not uploaded or saved by this tool.

    Why use SVG instead of PNG or JPG?

    SVG stays sharp at any size, usually has a smaller file size for icons and simple graphics, and can be styled with CSS. PNG and JPG are better for photographs and complex images.