Skip to content

Instantly share code, notes, and snippets.

@ondrek
Created November 11, 2013 13:48
Show Gist options
  • Select an option

  • Save ondrek/7413434 to your computer and use it in GitHub Desktop.

Select an option

Save ondrek/7413434 to your computer and use it in GitHub Desktop.
Smallest Base64 image
data:image/gif;base64,R0lGODlhAQABAAAAACw=
@RamonFLstate
Copy link

Just try this service: link

Tried the tool in the link with the bare minimum settings of 1, 1, 1 and the result was:

iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGI6MCsWEAAA//8D3QG6Bc6D/gAAAABJRU5ErkJggg==
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAEElEQVR4nGI6MCsWEAAA//8D3QG6Bc6D/gAAAABJRU5ErkJggg==

Nice tool.

@RamonFLstate
Copy link

RamonFLstate commented Sep 27, 2024

Smallest(that I know) Base64 images: Black, White and Transparent(Clear)

1 pixel good for PHPs and JavaScripts because don't have any // or ++ and other symbols that can interfere(also small, only Black PNGs for What I know ):
PNG Black data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQImWNgYGAAAAAEAAGjChXjAAAAAElFTkSuQmCC
PNG Black data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQYGWNgYGD4DwABBAEAqXIB5QAAAABJRU5ErkJggg

Normal, No Code Amicable:

GIF White data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs (Smallest that I know)

GIF Black data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw

GIF Clear data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw

PNG White data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQImWP4//8/AAX+Av5Y8msOAAAAAElFTkSuQmCC

PNG Black data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw

PNG Clear
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAQSURBVHjaYvj//z8DQIABAAj8Av7bok0WAAAAAElFTkSuQmCC

I hope this helps.
Best regards,
Ramón

@exec228
Copy link

exec228 commented Jul 24, 2025

<img src="data:image/x-icon;base64," alt="Placeholder icon" />
Does it solve your task?

@evnchn
Copy link

evnchn commented Jan 12, 2026

Elected to use https://gist.github.com/ondrek/7413434?permalink_comment_id=4693141#gistcomment-4693141, but then realized that R0lGODl should be image/gif

@RamonFLstate you may want to change the comment above.

@evnchn
Copy link

evnchn commented Jan 12, 2026

Oh so the root-cause is that the service mentioned in https://gist.github.com/ondrek/7413434?permalink_comment_id=5209693#gistcomment-5209693 (https://yulvil.github.io/gopherjs/02/) returns PNG (iVBOR) no matter what you set it to in the frontend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment