Home › Resources & tools › What are data URLs?

What are data URLs?

Data URLs are a special type of URL that, instead of pointing to an external resource available at the specified address, directly include the content of the resource within the URL string. These pseudo URLs support all content types (text, images, audio, etc.) and, like "regular" URLs, they can be linked and navigated to in the web browser.

The data URL scheme

Technically speaking, the term data URL refers to a URI that uses the data URL scheme—i.e. starts with "data:" and not with "http:", "file:", or "blob:", for example. The data URL scheme is defined by RFC 2397 published in 1998, and according to that specification, a well-formed data URL always looks like this:

data:[<mediatype>][;base64],<data>

where the optional <mediatype> component captures the media type of the embedded content, and the presence of ;base64 indicates that the <data> part is base64-encoded. Note that the media type itself can include one or many parameters separated by semicolons, e.g. text/plain;charset=utf-8.

See also

Generate data URLs in the browser.

How to generate data URLs in JavaScript?

All prices listed are in United States Dollars (USD). Visual representations of products are intended for illustrative purposes. Actual products may exhibit variations in color, texture, or other characteristics inherent to the manufacturing process.