Eksempler
A short text file
Du skriver inn
- byte
- Hello, World!
- MIME-type
- text/plain
Du får
- Base64
- SGVsbG8sIFdvcmxkIQ==
- Data-URI
- data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==
- Byteantall
- 13
Base64 turns every 3 bytes into 4 text characters. Thirteen bytes do not divide by 3, so the output ends with two equals signs as padding.
Kjørt med verktøyets egen kode.
The start of a JPEG file
Du skriver inn
- byte
- 255; 216; 255
- MIME-type
- image/jpeg
Du får
- Base64
- /9j/
- Data-URI
- data:image/jpeg;base64,/9j/
- Kan forhåndsvises som bilde
- ja
Three bytes become exactly four characters and need no padding. Because the type is a common image type, the page would also show an image preview.
Kjørt med verktøyets egen kode.
A file with no known type
Du skriver inn
- byte
- 1; 2; 3; 4
- MIME-type
Du får
- Data-URI
- data:application/octet-stream;base64,AQIDBA==
- MIME-type
- application/octet-stream
If the browser gives no usable MIME type, the tool labels the data application/octet-stream, which means unknown binary data.
Kjørt med verktøyets egen kode.
A file over the size limit
Du skriver inn
- Størrelse
- 2 MiB plus 1 byte
The limit is 2 MiB, which is 2,097,152 bytes. One byte more is refused before encoding starts, both in the page and in the encoding function.
Kjørt med verktøyets egen kode.