Get the Original Image from a Data URL

Avatar of Chris Coyier
Chris Coyier on (Updated on )

Someone wrote in asking how they might get the “original image” when all they had was the data URL version of the image. I’m not exactly sure how you get into that situation, but hey, I woke up in a trunk more than once.

You can absolutely get the original back, by exploiting the wonderful powers of the browser.

Here is the data they have:


Plop that sucker in an <img> tag and open in the browser and you’ll see it render:

Now you can drag it out of the browser into your local file system:

And that file will be the original: