SVG to MSDF

Signed distance fields from your SVG: crisp icons and shapes at any size, in any engine.

Try:
Paste SVG code
Type
More options

Drop an SVG to start

Or try one of the samples on the left.

Drawn the way a game draws it: from the small texture, scaled up. Zoom in: the edge stays sharp.

Texture
–
–
Shape
–
–
Made in
–
on your device
Using it in your engine

Import the PNG as linear data (sRGB off), no mipmaps and no compression that blurs it. In your shader or material:

Median  = max(min(R, G), min(max(R, G), B))
Opacity = saturate((Median - 0.5) * Sharpness + 0.5)

Sharpness is about the distance range times how many times bigger the shape is drawn than the texture (a 64 px texture drawn 512 px big with range 4: 4 × 8 = 32). For an outline, compare the median (or MTSDF's alpha) with a lower value than 0.5. SDF and PSDF have one channel: use R instead of the median.

  • Unreal / UEFN: Compression UserInterface2D (RGBA), sRGB off, Mip Gen NoMipmaps; the formula in a UI or masked material.
  • Unity: sRGB (Color Texture) off, Generate Mip Maps off, Compression None; the formula in Shader Graph.
  • Godot: mipmaps off, filter linear; the formula in a canvas_item or spatial shader.
  • Blender: an Image Texture node set to Non-Color, Separate Color, the formula with Math nodes into Alpha.

Licenses

The distance field code is a JavaScript port of msdfgen (github.com/Chlumsky/msdfgen):

MIT License

Copyright (c) 2014 - 2025 Viktor Chlumsky

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.