This SVG to Android Vector Drawable converter turns any SVG file into a ready-to-use VectorDrawable XML for your Android project. Drop an SVG, copy the generated XML, and paste it into res/drawable/ — done in under 5 seconds. Supports 14 SVG feature classes including paths, gradients, clip-path, opacity, fill-rule, and CSS inline styles. No upload, no signup, no daily limit.
How to convert SVG to Android Vector Drawable
Converting SVG to Android Vector Drawable takes 3 steps: drop the SVG file, set the size in dp, and download the generated XML. The tool parses your SVG, converts <path>, <rect>, <circle>, <ellipse>, <polygon>, and gradient elements into Android-compatible XML attributes (android:pathData, android:fillColor, etc.) and outputs a valid res/drawable/*.xml file. Conversion typically completes in under 100 milliseconds for icons and under 1 second for complex illustrations.
Drop your SVG file or paste SVG code. The tool parses paths, basic shapes, gradients, clip-paths, and CSS styles.
Set size in dp (default 24×24 — standard Material icon size) and optionally apply a tint color via android:tint.
Copy XML or download .xml. Place file in res/drawable/, name it ic_*.xml (e.g. ic_settings.xml), reference as @drawable/ic_settings.
What is the difference between SVG and Android Vector Drawable XML?
SVG is a W3C web standard, while Android Vector Drawable is a subset of SVG with Android-specific naming. Both are XML-based vector formats, but they use different namespaces and attribute names: SVG uses fill="#hex" while VectorDrawable uses android:fillColor="#hex". SVG has more features (filters, text, embedded images), but Vector Drawable is optimized for Android — it scales perfectly across 5 density buckets (mdpi to xxxhdpi) without loss and renders natively on the GPU. Android does not support SVG files directly — you must convert to Vector Drawable XML first.
SVG vs Android Vector Drawable
| SVG | Android VectorDrawable | |
|---|---|---|
| Format | XML (SVG namespace) | XML (Android namespace) |
| Platform | Web, desktop | Android only |
| Coordinates | viewBox units | dp (density-independent pixels) |
| Paths | <path d="..."> | <path android:pathData="..."> |
| Colors | fill="#hex" | android:fillColor="#hex" |
| Scaling | viewBox + width/height | viewport + width/height in dp |
| File location | Anywhere | res/drawable/ |
How to use in Android
<!-- In layout XML -->
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
app:srcCompat="@drawable/ic_your_icon" />
<!-- In Jetpack Compose -->
Icon(
painter = painterResource(R.drawable.ic_your_icon),
contentDescription = "Icon"
)What SVG features are supported?
| SVG feature | Status | Notes |
|---|---|---|
| Paths (d attribute) | Full | Direct mapping to android:pathData |
| Basic shapes (rect, circle, ellipse, line, polyline, polygon) | Full | Auto-converted to path data |
| Fill / Stroke colors | Full | Hex, named colors, rgb() |
| Stroke width | Full | android:strokeWidth |
| Opacity / fill-opacity / stroke-opacity | Full | fillAlpha, strokeAlpha |
| fill-rule (evenodd) | Full | android:fillType="evenOdd" |
| Linear gradients | Full | Via aapt:attr + <gradient> |
| Radial gradients | Full | Including objectBoundingBox unit conversion |
| Clip-path | Single path | Wraps in <group> with <clip-path> |
| CSS inline styles | Full | style="fill:#fff" parsed correctly |
| Text elements | No | Convert text to paths in design tool first |
| Embedded images | No | Use BitmapDrawable instead |
| Filters (blur, drop-shadow) | No | Android limitation, not supported |
| <use> references | No | Inline the referenced shape manually |
How do I convert SVG to XML for Android?
"SVG to XML for Android" usually means converting an SVG file into Android Vector Drawable XML — the only XML-based vector format Android natively supports. Place the generated .xml in app/src/main/res/drawable/, then reference it as @drawable/your_filename in layouts or R.drawable.your_filename in code. Vector Drawable XML files are typically 2–5 KB and replace the need for multiple PNG densities (saving 30–80% APK size for icon-heavy apps).
How is SVG to Drawable XML different from SVG to PNG?
SVG to Drawable XML produces vector output (resolution-independent, ~5 KB), while SVG to PNG produces raster output (fixed resolution, ~10–100 KB per density). For Android apps, prefer Drawable XML for icons and simple illustrations — they scale perfectly on every device from mdpi (160 DPI) to xxxhdpi (640 DPI) and modern Android (5.0+) supports them natively. Use PNG only for photographs, complex artwork that doesn't render correctly as vector, or pre-Lollipop devices. If you need PNG output, use our SVG to PNG Converter instead.
Vector Drawable converter vs Android Studio Vector Asset Studio
| imglogotool.com | Android Studio Vector Asset Studio | |
|---|---|---|
| Speed | Under 1 second per file | 5–20 seconds (IDE startup) |
| Browser-based | Works on any OS | Requires Android Studio install (3 GB+) |
| Gradients | Full support | Manual XML editing required |
| Clip-path | Single path | Strips silently |
| CSS inline styles | Parsed | Often skipped |
| Bulk processing | One at a time | One at a time |
| Cost | Free | Free |
Common SVG conversion errors and fixes
"Vector drawable supports only path tags." This Android Studio error happens when your XML has unsupported elements. Our converter automatically detects and warns about unsupported features (text, embedded images, filters) and silently skips them — you'll see warnings in the UI before downloading.
"Pixel data may not be ready" or icon appears blank: usually caused by missing android:viewportWidth / android:viewportHeight. The converter always emits these, calculated from your SVG's viewBox attribute (or width/height as fallback).
Color appears wrong: Android requires full 6-character hex (#RRGGBB) or 8-character with alpha (#AARRGGBB). Short SVG hex (#fff) is auto-expanded to #FFFFFF by the tool.
Related tools
Need to convert SVG to PNG instead? Use the SVG to PNG Converter — export at any resolution from 16px to 4096px.
Need to edit SVG first (recolor, move elements, group)? The SVG Editor opens any SVG visually.
Need Android launcher icons (mipmap with adaptive foreground/background)? Use the Android Launcher Icon Generator for all density buckets + Play Store 512×512.
Need standard icon sizes (Material 24/48/96 dp)? The Icon Resizer handles iOS, Android, Web, Social presets.
Need Chrome extension icons (16/32/48/128px)? The Chrome Extension Icon Generator creates Manifest V3 sizes.
Publishing to Play Store? Use the Feature Graphic Generator for 1024×500 store banners.
Need favicon for your project's website? The Favicon Generator creates multi-size .ico files.
Frequently asked questions
How do I convert SVG to Android Vector Drawable?
Drop your SVG file into the converter above. It automatically converts SVG paths, colors, and shapes to Android VectorDrawable XML format. Copy the code or download the .xml file.
What is an Android Vector Drawable?
Android VectorDrawable is Android's native vector graphics format. It uses XML with Android-specific attributes (android:pathData, android:fillColor) instead of SVG attributes. It scales perfectly on all screen densities.
Is this converter free?
Yes, 100% free. No signup, no limits. All conversion runs in your browser — your SVG files never leave your device.
What SVG features are supported?
Paths, basic shapes (rect/circle/ellipse/line/polygon), fill + stroke colors, opacity, fill-rule, CSS inline styles, linear gradients, radial gradients, and single-path clip-path. Not supported (Android limitation): text elements, embedded images, filters (blur/drop-shadow), and <use> references.
Do gradients work in VectorDrawable?
Yes. Linear and radial gradients convert to Android <gradient> elements via the aapt:attr namespace. The tool handles both userSpaceOnUse and objectBoundingBox coordinates, and resolves xlink:href stop inheritance.
Does clip-path work?
Single-path clip-paths convert to <clip-path android:pathData> wrapped in a <group>. Multiple clip paths or complex clipping (clipPathUnits=objectBoundingBox) are not supported by Android VectorDrawable.
Where do I put the XML file in my Android project?
Place the .xml file in res/drawable/ folder. Name it with lowercase and underscores, e.g., ic_my_icon.xml. Reference it as @drawable/ic_my_icon in layouts or R.drawable.ic_my_icon in code.
Does it work with Jetpack Compose?
Yes. Use painterResource(R.drawable.ic_your_icon) in Compose. Vector Drawables work with both traditional Views and Jetpack Compose.
Why not just use SVG directly in Android?
Android does not natively support SVG files. You need to convert to VectorDrawable XML format. Android Studio has a built-in converter (Vector Asset Studio), but this online tool is faster for quick conversions.