Data URI Generator & Parser
Generate Data URIs from text or files, and parse existing Data URIs to extract their content and metadata.
Last Updated: August 2026
100% Client-Side — Your data never leaves your device
Generation Options
Data URIs in Code
How to programmatically generate and parse Data URIs.
JavaScript
// Generate a Data URI from text
const text = "Hello World";
const base64 = btoa(text);
const dataUri = `data:text/plain;base64,${base64}`;
console.log(dataUri); // data:text/plain;base64,SGVsbG8gV29ybGQ=
// Parse a Data URI
const uri = "data:text/plain;base64,SGVsbG8gV29ybGQ=";
const match = uri.match(/^data:([^;,]*)(;base64)?,(.*)$/);
if (match) {
const mime = match[1];
const isBase64 = !!match[2];
const data = match[3];
const decoded = isBase64 ? atob(data) : decodeURIComponent(data);
console.log({ mime, decoded }); // { mime: "text/plain", decoded: "Hello World" }
}Frequently Asked Questions
Search below or browse through our most commonly asked questions.
A Data URI is a scheme that allows you to include data in-line in web pages as if they were external resources. It's often used to embed images in CSS or HTML.
No, Data URIs can also contain plain text or URL-encoded data. However, Base64 is the standard for embedding binary files like images.