decode base64 svg data to a svg file

base64, data-uri, decode, linux, svg

Solution

You can copy/paste the string (`data:image` etc. included) in the url bar of a modern browser; it will decrypt it for you. Then you can simply save the page as an svg.

Problem

I have a file containing a svg image which is base64 encoded (data-uri). The file starts with data:image/svg+xml;base64,PHN.... How to decode this to a .svg file in linux ?

Original source