How to Turn an Image Into Base64 Text
Images & PDF · Step-by-step guide · 5 steps · 2 min read
This tool turns a picture into a long line of text, called a data URI. You can paste it straight into a web page. It can also turn that text back into a picture.
Open the Image to Base64 Data URI Converter
In the pictures, orange letters like A show where to look. Each step tells you its letter.
Step 1: Choose the direction
Pick Image → Base64. Or pick Base64 → Image to go back. See A in the picture.
Step 2: Choose your image
Press Choose an image and pick a file. See B in the picture.
Step 3: Pick the result type
Choose how you want the text. For example Data URI, CSS background-image or HTML <img> tag. See C in the picture.

Step 4: Check the result
The text shows with a preview and its size. See D in the picture.
Step 5: Copy it
Press Copy data URI or Copy CSS background. Then paste it into your code. See E in the picture.

Tips and questions
When should I use a data URI?
For small icons in emails, web pages or CSS. Then you need no separate image file. For big photos, a normal image file loads faster.
Why is the text bigger than the image?
Base64 makes data about one third bigger. That is normal.
How do I turn the text back into a picture?
Switch to Base64 → Image. Paste the text and press Decode. Then press Download Image.
Privacy
Images are changed in your browser and never sent to us.
Try it now
The Image to Base64 Data URI Converter is free. You do not need an account.
Open the Image to Base64 Data URI Converter