DEV Community

Niels Swimburger.NET ๐Ÿ”
Niels Swimburger.NET ๐Ÿ”

Posted on โ€ข Originally published at swimburger.net on

Introducing online base64 image encoder

In addition to loading images on an HTML page by referencing the image via URL, you can also embed the base64 string of the image. In most cases, this is not a good idea because it will make your HTML page much larger in size and the image won't be cached by URL. Though, there are some edge cases where this is useful.

This little tool generates the base64 data URL for the file you select without uploading it to a server.

The base64 encoding happens inside your browser. You can find this little tool here: Online base64 image encoder

Screenshot of "Online base64 image encoder" tool

Alternatively, you can use the following PowerShell command on Windows: [convert]::ToBase64String((get-content "PATH_TO_IMAGE_HERE" -encoding byte)).

On Linux, you can use the following command base64 "PATH_TO_IMAGE_HERE".

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs