Apple does not publish a specification of .webloc itself. Sources for
this page: Howard Oakley’s Data formats used in textClipping, webloc and mailloc
files 1994–2025 (The Eclectic Light Company, 2025), and the Mozilla code Chromium
carries for reading these files (third_party/mozilla/NSURL+Utils.m). In
the newer form the file is an Apple property
list whose root is a dictionary with a URL key; the property list
formats are documented on their own pages.
Keys
| Key | Type | Value |
|---|---|---|
URL | string | The address as a string, such as https://example.com/. |
Oakley describes .mailloc files the same way, and notes that Firefox
has written .inetloc files of similar content; the Mozilla code reads
.ftploc files with the same routine.
XML form
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>URL</key>
<string>https://example.com/</string>
</dict>
</plist>
Binary form
The property list may also be binary; Oakley describes the newer data formats,
introduced in about 2015, as binary property lists. Written by hand to the
bplist00 layout, the same dictionary is 73 bytes:
00000000 62 70 6C 69 73 74 30 30 D1 01 02 53 55 52 4C 5F bplist00...SURL_
00000010 10 14 68 74 74 70 73 3A 2F 2F 65 78 61 6D 70 6C ..https://exampl
00000020 65 2E 63 6F 6D 2F 08 0B 0F 00 00 00 00 00 00 01 e.com/..........
00000030 01 00 00 00 00 00 00 00 03 00 00 00 00 00 00 00 ................
00000040 00 00 00 00 00 00 00 00 26 ........&
| Offset | Bytes | Meaning |
|---|---|---|
0x00 | bplist00 | Binary property list, version 00. |
0x08 | D1 01 02 | Object 0: a dictionary of 1 pair; key is object 1, value is object 2. |
0x0B | 53 55 52 4C | Object 1: an ASCII string of 3 characters, URL. |
0x0F | 5F 10 14 … | Object 2: an ASCII string whose length (20) follows as an integer object, then https://example.com/. |
0x26 | 08 0B 0F | Offset table: where objects 0, 1 and 2 start. |
0x29 | 32 bytes | Trailer: 6 unused bytes, offset size 1, object reference size 1, 3 objects, top object 0, offset table at 0x26. |
Resource fork form
The older form keeps the address in the file’s resource fork. Oakley: webloc and
mailloc resource forks hold only a 'drag' resource (number 128) listing
the others, and the URL as strings in both 'TEXT' and
'url ' resources; this form has been used since the last century and is
still created. The Mozilla reader looks first for the 'url ' resource
with ID 256 and falls back to the property list’s URL key. A file that
loses its resource fork, for example on a disk without them, keeps only what is in
its data fork.