IMAGE BASE64 TOOLOpen converter

svg to base64

Encode a remote SVG URL

SVG to Base64 encoding runs in your browser. Files are not uploaded to this site.

Internal gradient and clipping roundtrip

This supplied experiment record reports that internal gradient and clipping targets survived the roundtrip, with the same clipping rectangle and no different rendered pixels.

Provenance: the site owner supplied these recorded measurements. The original specimen and raw render captures were not supplied with this record; these are not a new measurement performed by this page.

  • Dangling references (recorded count): 0.
  • Clipping rectangle (recorded coordinates): x=20 y=30 width=120 height=90, exactly the same as the original.
  • Clipping area (calculated): 10800 square user units.
  • Canvas (recorded dimensions): 240×160.
  • Clipping share (supplied calculated result): 28.12%.
  • Original SVG (recorded size): 694 bytes.
  • Base64 payload (recorded length): 928 characters.
  • Decoded SVG (recorded size): 694 bytes.
  • Byte comparison (recorded result): completely identical.
  • SHA-256 comparison (recorded result): identical.
  • Expansion (supplied calculated result): 33.72%.
  • Rendered pixels compared (recorded count): 38400.
  • Different rendered pixels (recorded count): 0.
  • Maximum channel difference (recorded result): 0.

Calculation method: clipping area = width × height; clipping share = clipping area / canvas area × 100%; Base64 expansion = (payload characters / original bytes − 1) × 100%. Supplied percentage values are reproduced verbatim, without recalculation or changes to rounding.

Supported input and output

Choose or drop one SVG file, paste SVG markup, or read a public SVG URL when its server permits browser access. This SVG to Base64 converter produces a data URI, plain Base64, CSS background code, HTML favicon, hyperlink, image and iframe code, JavaScript image and popup code, JSON or XML. Copy or download the result. Available device memory limits input size.

How do I convert SVG to Base64?

Select a file for immediate encoding, or paste markup and click Encode SVG. File input encodes the supplied bytes; pasted markup is encoded as UTF-8. A remote URL uses a browser request without a server proxy.

Does this tool inspect references?

No. The encoder does not validate visitor SVG references, sanitize files or compare rendered pixels. The record above describes the supplied specimen only. Encoding and copying do not upload SVG files to this site.

SVG source is a byte sequence

Related experiment: How to Stream Base64 into UTF-8 Text in Python — watch on YouTube.