Skip to content

AR.js

AR.js is a lightweight JavaScript library designed for augmented reality experiences directly within web browsers, supporting image, location-based, and marker tracking.

Free · API

stork
I am a flat drawing.
One flat drawing and one typed sentence.
This drawing was never animated.
A photo, a cartoon, a painting or a 3D character. From 10 cents a minute. Free to try.
Make a photo talkDevelopers: there is an API

What is AR.js?

AR.js is a JavaScript library tool developed by AR-js-org that enables web developers to create augmented reality experiences directly within web browsers. It eliminates the need for app downloads and leverages existing web technologies like Three.js, A-Frame, and WebRTC. AR.js supports various tracking methods, including image tracking, location-based AR, and marker tracking, and is optimized for performance on mobile devices.

Key Features of AR.js

AR.js provides a comprehensive set of features for developing web-based augmented reality applications, focusing on accessibility and performance across various devices.

  • Image Tracking: Overlays digital content on or near detected 2D images.
  • Location-based AR: Displays AR content based on the user's real-world geographical position.
  • Marker Tracking: Utilizes predefined markers (pattern or barcode) for stable content overlay.
  • Optimized for mobile devices: Designed for efficient performance, running at 60 frames per second.
  • Integration with A-Frame: Seamlessly integrates with A-Frame for declarative 3D scene rendering.
  • Integration with Three.js: Compatible with Three.js for advanced 3D graphics and animations.
  • Supports diverse content: Renders 2D images, GIFs, 3D models (animated), and 2D video content.
  • Pure web solution: Operates entirely within web browsers, requiring no external installations.
  • JavaScript-based: Built on JavaScript, making it accessible to web developers.
  • Barcode Marker Support: Includes support for AR_MATRIX_CODE_5x5_BCH_22_12_5, AR_MATRIX_CODE_5x5_BCH_22_7_7, AR_MATRIX_CODE_5x5, and AR_MATRIX_CODE_6x6.

Who Should Use AR.js?

AR.js is suitable for developers and organizations looking to implement augmented reality experiences directly through web browsers, avoiding the complexities and costs associated with native mobile application development. Its open-source nature and performance optimizations make it ideal for a range of interactive and educational applications.

  • Web Developers: For creating interactive business cards, educational flashcards, or simple augmented print advertisements using HTML and JavaScript.
  • Educators and Content Creators: To develop augmented books, interactive learning materials, and biology or history learning games.
  • Marketing and Advertising Agencies: For augmented flyers, advertising campaigns, and interactive product showcases.
  • Tourism and Cultural Institutions: To build interactive tourist guides, assistance for exploring new cities, and situated art experiences bound to specific real-world coordinates.
  • Gaming and Entertainment: For creating treasure hunts and location-based interactive games.

How to Use AR.js

Getting started with AR.js typically involves including the library in an HTML file and configuring the AR scene using A-Frame or Three.js. The process is designed to be straightforward for web developers.

  1. Include AR.js: Add the AR.js library script to your HTML file, often alongside A-Frame or Three.js.
  2. Set up Camera: Configure the user's device camera for AR input using WebRTC.
  3. Define AR Scene: Create an A-Frame scene or Three.js renderer to host your 3D content.
  4. Implement Tracking: Choose and configure a tracking method (image, marker, or location-based AR) using AR.js components.
  5. Place Content: Position 2D images, GIFs, 3D models, or videos within the AR scene based on tracking data.
  6. Test on Device: Deploy and test the web AR experience on a mobile device with WebGL and WebRTC support.

AR.js Pricing & Plans

AR.js is an open-source project, making it entirely free to use for all developers and organizations. There are no licensing fees, subscription costs, or usage-based charges associated with its core functionalities.

  • Open Source: Free

Pros

  • Completely open-source and free of charge, making it highly accessible.
  • Lightweight and fast, running efficiently at 60 frames per second even on older smartphones.
  • Pure web solution, eliminating the need for app downloads or installations.
  • Supports multiple AR tracking methods: image, marker, and location-based AR.
  • Integrates seamlessly with popular web 3D libraries like A-Frame and Three.js.
  • Active community and substantial documentation repository for support.

Cons

  • May have fewer advanced features compared to more comprehensive WebXR tools.
  • Location-based AR may not work correctly on Firefox due to issues with obtaining absolute device orientation.
  • Some users reported issues with glb/gltf format and animations several years ago, though recent updates address some compatibility.
  • While continuously developed, some specific features might be less frequently maintained than dedicated projects (e.g., LocAR.js for location-based AR).

AR.js vs Competitors

AR.js occupies a distinct niche in the WebAR ecosystem, primarily due to its open-source nature, performance, and specific focus on marker-based and location-based AR. It differentiates itself from native browser APIs and other libraries through its ease of use and broad compatibility.

See every AR.js alternative, compared

AR.js

Free · API

Enjoying this? Get one like it in your inbox each morning.

one email a day · unsubscribe in two clicks · no third-party tracking