SVG is short for Scalable Vector Graphics. It is a graphic format in which the shapes are specified in XML. The XML is then rendered by an SVG viewer. Today most web browser can display SVG just like they can display PNG, GIF, and JPG.
Internet Explorer 8 (and earlier) users may have to install the Adobe SVG Viewer to be able to view SVG in the browser. IE 9+, Chrome and Firefox all support SVG natively.
SVG is for 2-dimensional vector graphics. For a 3-dimensional format lookup X3D.
If you are not sure if SVG is right for you or your project, take a quick look at the SVG Examples page to get a quick overview at the capabilities of SVG.
SVG Tutorials as Video
I have a video version of this text here:
I also have a YouTube play list for all my SVG videos.
SVG is for Vector Graphics
Being a vector graphics format SVG is mostly useful for vector type diagrams like:
- Two-dimensional graphs in an X,Y coordinate system.
- Column charts, pie charts etc.
- Scalable icons and logos for web, tablet and mobile apps and webapps.
- Architecture and design diagrams
Being a "Vector Graphics" format the shapes to be displayed are stored as vectors or vector-like structures. In other words, as numbers. Not as pixels.
Being "Scalable" means that the viewer can scale the SVG image up and down in size without loss of quality. This is possible because the graphics are defined as numbers instead of pixels. Scaling the SVG image up or down just means multiplying or dividing the numbers defining the SVG shapes.
SVG is not ideal for bitmap graphics like photos, movies etc. although you can embed bitmap graphics in an SVG image. This can be a handy way to draw shapes or text ontop of a bitmap image.
SVG is Ideal for Generated Images / Graphs / Diagrams
Being an XML format (a textual format) SVG is rather easy to generate from within a Servlet, JSP, ASP.NET, PHP or other web application technology. This makes SVG ideal for computer-generated graphs and diagrams. Interestingly, you often need to generate exactly the type of diagrams for which SVG is ideal (graphs, charts, diagrams etc.) in web applications. This makes SVG an even better match for generating graphs and diagrams.
About this Tutorial
The purpose of this tutorial is to get you up and running with SVG in a short time, and to be able to use the tutorial as a quick reference afterwards as well. While I will try to cover as much as possible of SVG, it is not the intention to cover each and every little bit of the SVG specification. Once you have a decent understanding of the basics you can easily consult the SVG specification on more advanced or special case topics.
This tutorial is "work in progress". If you want to be notified of new texts in this trail, you can subscribe to the RSS Feed.
If you want to play around with some of the examples in this tutorial, or just want to play around with SVG, I have created a simple, online SVG editor called ScriptDraw. You can find it here: