SVG to Compose Converter (ImageVector)

Paste an SVG icon and get ready-to-use Kotlin ImageVector code for Android Jetpack Compose.

Recent conversions stay in this browser only. Clear them anytime.

SVG Input

Paste or drop an SVG 0 chars
Ln 1, Col 1
0 B

Compose ImageVector

Icon Lab

Paste SVG to see preview

Conversion Report

Waiting for SVG
Paths
0
Elements
0
Warnings
0
Viewport
-

    Conversion data is sent only for processing. Browser history is local to this device.

    Recent Conversions

    Stored only in this browser.

    Your recent SVG conversions will appear here.

    Examples Gallery

    Supported SVG Elements

    <path>
    <rect>
    <circle>
    <ellipse>
    <line>
    <polygon>
    <polyline>
    <g> groups

    All SVG path commands (M, L, H, V, C, S, Q, T, A, Z) are supported in both absolute and relative forms. Fill colors, stroke, opacity, and fill-rule (EvenOdd / NonZero) are preserved.

    SVG to Compose Resources

    Use the converter above for the work. These short guides cover ImageVector exports, custom Compose icons, and path data details without crowding the tool.

    FAQ

    What is an ImageVector?

    ImageVector is Jetpack Compose's built-in vector graphic representation. It replaces Android's XML VectorDrawable format and lets you define icons directly in Kotlin with full type-safety.

    Why not use Android Studio's built-in SVG converter?

    Android Studio converts SVGs to XML VectorDrawable, not Compose ImageVector. This tool skips the XML step and gives you pure Kotlin code you can paste directly into your Compose project.

    Are gradients supported?

    Currently we convert solid fills and strokes. Linear/radial gradients in SVG will be flattened. We recommend simplifying gradients in your SVG editor before converting.

    How to convert SVG to Compose

    Paste your SVG markup into the input box or drop a file on it, then set the icon name. The converter produces Kotlin ImageVector code that you can copy into your Android or Compose Multiplatform project. The preview shows the icon at common sizes and on light, dark and checkered backgrounds.

    Before you copy the code, check the conversion report. It lists the number of paths and elements, the viewport and any warnings about parts of the file that could not be converted exactly.

    Using the generated icon

    Add the generated property to a Kotlin file and pass it to the Icon or Image composable through the imageVector parameter. Icon applies a tint, so use Image, or an unspecified tint, when you want to keep the original colors of a multicolor graphic.

    Getting clean results

    Icons convert best when text is turned into paths and effects such as filters, masks and embedded images are removed in your design tool. Keep a sensible viewBox, because it defines the viewport of the vector.

    More questions

    How do I use an SVG in Jetpack Compose?

    Convert it to an ImageVector, add the generated Kotlin to your project, and pass it to Icon or Image with the imageVector parameter. You can also import it as an XML VectorDrawable and load it with painterResource.

    Can I use the result in Compose Multiplatform?

    ImageVector is part of Compose UI and is available in Compose Multiplatform. Check the imports in your project after pasting the code.

    Related tools