Text to Data URL
Turn text into a base64 data URL in your browser. Set the MIME type and paste the result into CSS, HTML or JSON.
What this text to data url does
The text is encoded as UTF-8, then as Base64, and the MIME type you choose becomes the media type of the resulting data URL. Base64 is used rather than percent-encoding because it survives a copy through CSS, HTML attributes and JSON without further quoting.
How to use it
Text to Data URL: paste the text into the box above, set Mime (default "text/plain;charset=utf-8"), and press Run to get the data URL below.
Worked example
Input:
Hi
Output:
data:text/plain;charset=utf-8;base64,SGk=
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads text and returns data URL; reloading the page discards both.
The text is encoded as UTF-8, then as Base64, and the MIME type you choose becomes the media type of the resulting data URL. Base64 is used rather than percent-encoding because it survives a copy through CSS, HTML attributes and JSON without further quoting.
Turn text into a base64 data URL in your browser. Set the MIME type and paste the result into CSS, HTML or JSON.
How to use it
Text to Data URL: paste the text into the box above, set Mime (default "text/plain;charset=utf-8"), and press Run to get the data URL below.
Why it runs in your browser
The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads text and returns data URL; reloading the page discards both.
What to Expect
Best for
- Converting text to data URL when the data is already on screen.
What this tool keeps
- Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.
Sample input
Hi
Sample output
data:text/plain;charset=utf-8;base64,SGk=
Frequently asked questions
How do I use the text to data url?
Text to Data URL: paste the text into the box above, set Mime (default "text/plain;charset=utf-8"), and press Run to get the data URL below.
Is my input uploaded?
No. The text is parsed on this page with JavaScript and is never posted to a server.
Is there a size limit?
Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.