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
| Value | Description |
|---|---|
| data:,A%20brief%20note | Example 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/local | Example of RFC 2397 with a media type |
| data:text/plain;base64 invalid | No comma before the data |
| text/plain;base64,SGVsbG8sIFdvcmxkIQ== invalid | No data: scheme |
Translations
| Language | Name | Description |
|---|---|---|
| Russian | Data URI | URI схемы data:, который содержит небольшой файл прямо в адресе, например изображение в Base64 (RFC 2397). |
Sources
- wikipedia: https://en.wikipedia.org/wiki/Data_URI_scheme
- doc: https://www.rfc-editor.org/rfc/rfc2397
- doc: https://fetch.spec.whatwg.org/#data-urls
Use this record
- Page URL:
http://registry.apicrafter.io/datatype/data_uri - JSON: API v1 · legacy shape (used by metacrafter) · Markdown (for LLMs)
- Improve it: edit
data/datatypes/any/internet/data_uri.yamlon GitHub