Datatypes

Data URI (data: URL)

ID data_uri

DatatypeNot PIIDraft

This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).

URI of the data: scheme that carries a small file inline instead of pointing to it (RFC 2397): data:, an optional media type with parameters, an optional ;base64 flag, a comma and the data, percent-encoded or in Base64. HTML and CSS use it to embed images and fonts. Without a media type the data is text/plain;charset=US-ASCII. Browsers parse it as the WHATWG Fetch Standard describes, which is more lenient than RFC 2397.

Parent datatype
Uniform Resource Identifier (URI) uri
Categories
Internet
Countries
Global (not tied to a country)
Languages
Common to most languages
Quality
80/100 · missing: mapping (Wikidata, Schema.org, ...), detector coverage
Metacrafter rules
no detection rule yet
Supported by tools
no tool record lists this type yet

Regular expression

^data:(?:[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+)?(?:;[A-Za-z0-9!#$&^_.+-]+=[^;,\s]+)*(?:;base64)?,\S*$

Python re syntax.

Examples

ValueDescription
data:,A%20brief%20noteExample of RFC 2397: plain text without a media type
data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==The text Hello, World! in Base64
data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/localExample of RFC 2397 with a media type
data:text/plain;base64 invalidNo comma before the data
text/plain;base64,SGVsbG8sIFdvcmxkIQ== invalidNo data: scheme

Translations

LanguageNameDescription
RussianData URIURI схемы data:, который содержит небольшой файл прямо в адресе, например изображение в Base64 (RFC 2397).

Sources

Use this record