SVG إلى Data URI

حوّل ملفات SVG إلى سلاسل Data URI.

اسحب ملف SVG وأفلته

أو انقر للاختيار أو الصق كود SVG

يقبل ملفات .svg فقط
ألصق كود SVG باستخدام Ctrl+V / Cmd+V

المزايا الرئيسية

إدراج مدمج

حوّل SVG إلى Data URI لتضمينه في HTML.

خفيف الوزن

لا يوجد حاجة لملفات خارجية.

سريع

عملية التحويل سريعة وغير معقدة.

طريقة الاستخدام

1

Add Your SVG

Drag and drop a file or paste SVG markup. SVG to Data URI loads the source locally and preserves viewBox, IDs, and colors for accurate output. Open SVG files online and convert them right away.

2

Select an Encoding

Choose Base64 for maximum compatibility or URL encoding for shorter, readable strings. SVG to Data URI updates the output instantly so you can compare lengths before copying.

3

Copy and Embed

Copy the result and paste it into HTML, CSS, or JSON. SVG to Data URI strings are ready for img src, background-image, or inline style attributes.

الأسئلة الشائعة

What is an SVG Data URI and when should I use it?
SVG to Data URI embeds the SVG directly inside a URL string, so you can use it inline without hosting a separate file. This is useful for icons, small illustrations, and email templates where external requests are restricted.
SVG to Data URI: Base64 or URL-encoded, how do I choose?
SVG to Data URI supports both. Base64 is the safest choice for all contexts, while URL encoding is often shorter for simple shapes and is easier to edit or diff in source control.
Will SVG Data URI work in CSS background-image?
Yes. SVG to Data URI outputs a data:image/svg+xml string that can be placed inside background-image: url(...). This is a common pattern for patterns, icons, and decorative UI assets.
Is the conversion private?
SVG to Data URI runs locally in your browser, so assets never leave your device. This keeps proprietary logos or client icons safe and allows use on locked-down networks.
How large can the SVG be?
SVG to Data URI can process files up to 10MB. Very large SVGs will produce long strings, so optimization or using an external file may be more practical.
Should I optimize before converting?
Yes. SVG to Data URI results are shorter and more reliable when the SVG is optimized. Remove unnecessary metadata and whitespace to keep HTML or CSS compact.
Does it preserve colors and viewBox?
SVG to Data URI keeps viewBox, fills, strokes, and IDs intact, so the rendered output matches the source. If you rely on currentColor or CSS variables, keep them in the SVG before converting.
Is SVG to Data URI Converter free to use with no download?
Yes. SVG to Data URI Converter is free to use in your browser. No downloads or installation are required.
Do I need an account to use SVG to Data URI Converter?
No. SVG to Data URI Converter works instantly in the browser without sign-up, and files stay local.