SVG Tools

SVG → Base64

Encode original SVG content as Base64 while preserving vector graphics, text, and formatting.

Your SVG stays in your browser and is never uploaded to a server.

About This Tool

SVG → Base64 turns UTF-8 SVG content into text you can easily copy. Choose raw Base64 or a Data URI with the SVG media type prefix when you need a text-based image address.

How to Use

  1. Choose a UTF-8 SVG file or paste the complete SVG.
  2. Click Generate Base64 and check the raw Base64 result.
  3. Copy raw Base64 or a Data URI that includes the image type prefix.
  4. Download the text file, or use Base64 → SVG to check the decoded content.

Features

  • Encodes SVG directly without converting it to PNG or another pixel format.
  • Supports UTF-8 text, including accented characters, other writing systems, and emoji.
  • The main result is raw Base64. The Data URI adds the data:image/svg+xml;base64, prefix.

Encoding and your original file

  • Base64 is an encoding, not encryption, compression, or a safety filter. Anyone can decode and read the content.
  • The output preserves the original SVG, including any scripts or external references. Use it only where the file is trusted and appropriate.
  • Base64 usually adds about one-third to the original byte count. The Data URI prefix adds a little more.

SVG Safety

Previews use a filtered static copy. Scripts, click events, animations, external images, fonts, and styles do not run or load. External references, embedded web pages, and unsupported content are removed, so the preview may differ from the original. Documents with a DOCTYPE or custom entities are not supported.

SVG files and UTF-8 source are limited to 2 MiB, 20,000 nodes including elements and text, and 96 nesting levels. Simplify files that are too large or complex before trying again.

Privacy

Your SVG stays in your browser and is never uploaded to a server.

Inputs and results are not saved automatically. Download anything you want to keep before clearing the tool or leaving the page, and keep a copy of your original.

FAQ

What is SVG Base64?

It represents an SVG's UTF-8 bytes as a string of ASCII characters. Decoding it restores the SVG content.

Does Base64 make an SVG smaller?

No. Base64 usually increases length by about one-third. To reduce file size, try SVG Minifier first.

Can SVG Base64 be used as an image address?

Use a complete Data URI beginning with data:image/svg+xml;base64,. Some apps and pages restrict these addresses, so check whether your destination supports them.

Will encoding lose accented characters or emoji?

This tool uses UTF-8, which supports multilingual text and emoji. Decode with UTF-8 to restore the original characters.

Back to the Developer Tools Directory