All guides

How to convert an image to Base64

Turn an image into a Base64 data URI (or preview Base64 as an image) locally in Toolora.

When to use a data URI

Small icons and CSS backgrounds sometimes embed as data:image/...;base64,... so they load without an extra request. Large photos are usually better as files.

Steps

1) Open Image ↔ Base64 at /tools/image-base64. 2) On Image to Base64, pick or drop a file. 3) The data URI fills as soon as the file is read — encoding has no Run button. 4) To preview a string, paste it on Base64 to Image. 5) Copy the result. The file never leaves your browser.

Worked example

A 2 KB PNG icon becomes a long data:image/png;base64,... string suitable for a CSS background. A 4 MB photo will freeze a stylesheet — compress or resize first at /tools/image-compressor or /tools/image-resizer. Text Base64 Encode is for strings, not files. The preview uses an img element, not raw HTML injection.

Privacy

Pixels stay on the device. Related: /tools/base64-encode, /tools/image-compressor, /tools/image-converter. Close the tab after encoding ID photos.

Common mistakes

Embedding a full-resolution photo as a data URI will balloon HTML and CSS. Compress or resize first. Text Base64 Encode is the wrong page for files. Pasting a raw base64 blob without the data:image/... prefix into Base64 → Image may fail — include the data URI when the tool expects it. SVG as text is not this converter. Nothing is uploaded. Close the tab after ID photos or signed documents.