HTML archive Attribute

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The archive attribute listed space-separated URLs of archive files (often JAR files) that held resources for an embedded <object>. It was also used on the obsolete <applet> element for Java applets.

For new work, point <object> at the resource with data and type. Related legacy attributes include codebase and classid.

Deprecated / Obsolete.

Do not use archive on <object>. The HTML living standard lists it as obsolete — prefer data and type. Learn it to read old markup, not to ship it.

HTML Syntax

syntax.html
<object archive=" URL URL …">

URLs are separated by spaces (not commas). Relative or absolute paths were both allowed.

Attribute Values

What authors historically put in archive:

ValueDescriptionTry it
Single URLOne archive path, e.g. app.jar or /libs/app.jarTry it
Space-separated listSeveral archives, e.g. lib1.jar lib2.jarTry it
Modern alternativeOmit archive; use data + type (and fallback content)Try it

Live Preview

Toggle a legacy archive value on a sample <object>. Modern browsers will not run Java applets — this demo only shows the attribute.

Legacy study demo. Prefer data and type on <object> in real projects.

Object (fallback shown)

Fallback: the object resource cannot be displayed (expected in modern browsers).

archive="app.jar"

HTML Examples

Legacy snippets for study, plus the modern pattern. Use Try It Yourself for a live editor.

Example 1 — Single Archive URL (Legacy)

One JAR listed on <object> for supporting resources.

HTML
<object
  data="demo.jar"
  type="application/java-archive"
  archive="app.jar">
  <p>Your browser cannot display this object.</p>
</object>
Try It Yourself

How It Works

  1. object embeds an external resource (here a JAR).
  2. archive="app.jar" named one supporting archive URL.
  3. Fallback content inside <object> shows when the resource fails.
  4. Study only — do not rely on this in new sites.

Example 2 — Multiple Archive URLs (Legacy)

Space-separated list of JAR paths for libraries plus the main app.

HTML
<object
  data="myApp.jar"
  type="application/java-archive"
  archive="lib1.jar lib2.jar">
  <p>Your browser cannot display this object.</p>
</object>
Try It Yourself

How It Works

  1. data points at the main resource.
  2. archive lists extra JARs separated by spaces.
  3. Order was implementation-defined — treat the list as a set of URLs.
  4. Comma lists are wrong for this attribute (unlike accept).

Example 3 — Modern Object Without archive

What the living standard recommends: data + type, with clear fallback text.

HTML
<object data="/media/report.pdf" type="application/pdf">
  <p>
    PDF preview is unavailable.
    <a href="/media/report.pdf">Download the report</a>.
  </p>
</object>
Try It Yourself

How It Works

  1. No archive — obsolete plugin attributes are omitted.
  2. data + type describe the resource the browser should load.
  3. Fallback keeps the page usable when embed fails.
  4. Use this pattern for new <object> embeds.

Edge Cases & Pitfalls

Treat archive as historical — applets and plugin JARs are gone from the modern web.

obsolete

Not for new HTML

Validators flag archive on <object>. Remove it when you modernize templates.

spaces

Space-separated, not commas

Unlike accept, multiple URLs used spaces. Commas were incorrect for this attribute.

applet

<applet> is also obsolete

Do not revive Java applets. Browsers dropped the NPAPI/plugin path years ago.

param

Spec hint for named parameters

Old guidance: if a plugin needed a parameter named archive, use <param> — still not a reason to ship applets today.

vs codebase

Different from codebase

archive listed archive file URLs; codebase was a base directory for class/resources. Both are obsolete on object.

Browser Support

archive is a legacy HTML attribute for plugin/applet resources. Engines may still parse it, but Java applets no longer run.

✓ Deprecated · Obsolete

archive

Recognized in old documents for compatibility. Modern browsers do not execute applet JAR workflows. Prefer data and type on object.

Legacy Parse only
Google Chrome Attribute ignored for applets
Obsolete*
Mozilla Firefox Attribute ignored for applets
Obsolete*
Apple Safari Attribute ignored for applets
Obsolete*
Microsoft Edge Attribute ignored for applets
Obsolete*
Opera Attribute ignored for applets
Obsolete*
Samsung Internet Attribute ignored for applets
Obsolete*
Internet Explorer Legacy applet era
Legacy*
archive Obsolete (do not use)

Bottom line: *Parsed for old pages at best — not recommended. Do not build new features on archive or Java applets.

Key Takeaways

  • Role: list space-separated archive (JAR) URLs for an embedded object.
  • Status: obsolete on <object> — keep for reading legacy HTML only.
  • Replace with: data + type on <object>, plus fallback content.
  • List syntax: spaces between URLs — not commas.

One line: learn archive for old applet/object markup — ship data and type instead.

Frequently Asked Questions

On object (and historically applet), archive listed space-separated URLs of archive files — usually JARs — that held extra resources for the embedded content.
Yes. The HTML living standard marks archive on object as obsolete. Authors must not use it. Prefer data and type on object.
Primarily object. It was also used on the obsolete applet element for Java applets.
Yes. Use a space-separated list of URLs, for example archive="lib1.jar lib2.jar".
Use object with data and type for the resource. If a plugin needed an archive-named parameter, the old advice was a param element — but Java applets no longer run in modern browsers.
Yes for reading legacy pages. Do not use it in new projects.

Next: as

Hint the resource type on <link rel="preload"> and similar.

as tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful