designwithfocus

SVG to Base64

Paste or upload SVG, get clean output.

Free No sign-up Runs in your browser
Upload an SVG file, or paste SVG below
Drag and drop, paste, or click to choose a file.

Processed in your browser. Nothing is uploaded.

Base64 length364 characters
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+CiAgPCEtLSBBIHNpbXBsZSBtYXJrIC0tPgogIDxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjUyIiBmaWxsPSIjMUI3RjgwIiAvPgogIDxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjM0IiBmaWxsPSIjRkZDOTNDIiAvPgogIDxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjE2IiBmaWxsPSIjRkZGRkZGIiAvPgo8L3N2Zz4=

How to use SVG to Base64

  1. Paste your SVG code, or upload an SVG file.
  2. Adjust the options, then check the result.
  3. Copy or download the output.

How the SVG tool works

SVG is text, so the tool can edit it directly in your browser. Nothing is uploaded.

Optimising removes comments and extra whitespace. Converting changes the format, never the picture.

OutputUse
Minified SVGSmaller files for the web
Data URIInline SVG in CSS
JSXSVG as a React component
Base64Embedding SVG in other files

Good practice

Keep a copy of the original SVG. Minified code is hard to edit by hand.

Test the output in a browser before using it in production.

FAQ

Is SVG optimisation free?

Yes. It is free, with no sign-up.

Does it upload my SVG?

No. Everything runs in your browser.

Will optimisation change how my SVG looks?

No. It removes only comments, whitespace and redundant data.

Can I use the output in React?

Yes. The JSX converter produces a component you can paste into a React file.

Report a problem with this tool