What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 138 Stack Exchange communities.

I am unable to upload SVG image files to Stack Overflow. So I would like to know why it is blocked while other image formats are allowed. SVG images are useful for diagrams such as tree diagrams for algorithm discussions.

share|improve this question
So just convert them to PNG. Problem solved. –  Cody Gray May 25 '11 at 5:08
@TheEstablishment true, found online converter which works just fine from quick test I just did. –  Shadow Wizard Dec 3 '12 at 10:02
Converting to a raster format defeats the purpose behind SVG which is scalability. –  bgoodr Dec 7 '12 at 5:58
In addition to @bgoodr - scalability and edit friendly format. –  Tomáš Zato Dec 1 '14 at 14:06

4 Answers 4

up vote 11 down vote accepted

Stack Exchange supports image uploading by using an external service (imgur) which does not support vector images.

You'll need to convert your SVG into a raster format (PNG is probably the best choice for most vector images, but JPG, GIF, and even BMP are supported) before uploading them to the provided service.

Stack Exchange is not interested in building an image hosting service (which is why they use imgur) so it's unlikely that they will either create one, or encourage imgur to support vector image formats.

However, if you find a free vector image hosting service that can handle the load Stack Overflow puts on such a service, and provides an API that is as simple and easy to include as imgur's, then you might be able to convince Stack Exchange, Inc, to include support for your request.

Alternately you should consider going to imgur and requesting that they support vector image formats. It would be ideal if they did the hard work, because, using browser detection methods, they could also support browsers that don't have SVG support by rendering the image prior to display, or they could even render it on upload and only store the rendered image (thus not affecting their normal workflow since it's simply a raster image after upload and conversion).

Unless you make it trivial for Stack Exchange to include in their code, you are unlikely to get much support for your feature request.

share|improve this answer
That is asking end users of a product or service to supply an implementation, and constraining it further with vaguely defined words such as "easy". Not implementing it due to lack of browser support seems like a more reasonable rationale for saying "will not implement". –  bgoodr May 26 '11 at 20:28
Marking as answer as it was actually helpful. Thanks Adam. –  bgoodr May 26 '11 at 20:34
Stack Exchange has a special deal with imgur for custom image hosting. That makes them a paying customer, and apparently a pretty large one at that. If SE asked imgur for SVG support, they'd be a lot more likely to listen than if the request came from a random third party. –  Ilmari Karonen Oct 9 '14 at 16:31
@bgoodr I made an userscript that makes the image uploading easier and automatically converts SVG to PNG (by using CanvasDrawContext2D.drawImage()). –  Tomáš Zato Dec 1 '14 at 14:08

While you can't directly upload an svg image, if you can host it somewhere else you can still display it in your post using html like <img src="http://example.com/url/to/your/image.svg"/> tag like this US map here from wikipedia commons:


see this post for other examples of what you can do: Formatting Sandbox

share|improve this answer
True, however the whole point of dedicated image hosting is preventing rot i.e. cases where the original host is down, then the image is lost forever. –  Shadow Wizard Dec 3 '12 at 9:59
No I understand this, I just wanted to point out its still possible to show an svg. Would be nice if I could just paste the SVG code directly into a post (maybe you can but nothing I tried worked) but I could see the xml code taking up a lot of space on more complicated images –  WebChemist Dec 3 '12 at 10:01
Ideally, the StackExchange websites would provide the hosting services. –  bgoodr Dec 7 '12 at 5:59
Modern browsers will let you view inline svg xml right in the html, so its not like it would really need its own SO svg hosting service, they would just need to tweak the way posted svg code is shown... but easier said then done when you have to prevent XSS and that sort of stuff. Example of inline svg code in html: jsfiddle.net/webchemist/c6E7w –  WebChemist Dec 7 '12 at 6:23
Here, have a bounty for actually demonstrating a working method of using SVG on SE (even if it does require using a third-party image host). –  Ilmari Karonen Dec 26 '14 at 12:45

Images uploaded to Stack Overflow are hosted by imgur, and right now imgur doesn't support SVGs.

That said, it might be possible to just use them for binary storage and render the SVGs correctly here?

share|improve this answer

I'd imagine part of the reason is that Microsoft only support SVG since IE9, and most people use IE as their browser but have not upgraded to 9.

Examples of browser usage statitistics: http://www.w3counter.com/globalstats.php, http://gs.statcounter.com/#browser_version-ww-monthly-201004-201104-bar

Getting SVG support into IE8 would require a JS/flash plugin like SVG Web, which would cause significant bandwidth usage for an infrequent feature.

Either that or take the SVG markup and return a PNG. But that sounds like a lot of work for a Q&A website to undertake.

share|improve this answer
Browser usage for Stack Overflow itself tends more heavily towards Firefox, Chrome, and later versions of IE. –  Adam Davis May 25 '11 at 13:05
That and since April 2014, Microsoft no longer provides security updates for desktop operating systems that can't run IE 9 or later. –  tepples Nov 8 '14 at 4:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .