Skip to content
Collaborative Text Editor Powered by Firebase
JavaScript CSS CoffeeScript Shell HTML
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Remove bower dependencies in favor of npm. Jan 13, 2020
examples [firepad-release] Bumped examples to vv1.5.9 Jan 18, 2020
font Switch to icon font for toolbar, add buttons for features previously … Jul 22, 2013
tools Fix Jan 18, 2020
.gitignore Add .firebase to .gitignore. Jan 13, 2020
.travis.yml Remove bower dependencies in favor of npm. Jan 13, 2020 [firepad-release] Cleared after v1.5.9 release. Jan 18, 2020
Gruntfile.js Transpile coffee files through babel (#341) Jan 6, 2020
LICENSE Added back in license for ot.js which was accidentally removed Jun 1, 2016 [firebase-release] Updated Firepad to 1.5.3 Feb 8, 2019
bower.json [firebase-release] Updated Firepad to 1.5.3 Feb 8, 2019
package-lock.json 1.5.9 Jan 18, 2020
package.json 1.5.9 Jan 18, 2020

Firepad Build Status Coverage Status Version

Firepad is an open-source, collaborative code and text editor. It is designed to be embedded inside larger web applications.

Join our Firebase Google Group to ask questions, request features, or share your Firepad apps with the community.

Table of Contents

Getting Started With Firebase

Firepad requires Firebase in order to sync and store data. Firebase is a suite of integrated products designed to help you develop your app, grow your user base, and earn money. You can sign up here for a free account.

Live Demo

Visit to see a live demo of Firepad in rich text mode, or the examples page to see it setup for collaborative code editing.

a screenshot of including a picture of two cats and a discussion about fonts

Downloading Firepad

Firepad uses Firebase as a backend, so it requires no server-side code. It can be added to any web app by including a few JavaScript files:

  <!-- Firebase -->
  <script src=""></script>

  <!-- CodeMirror -->
  <script src=""></script>
  <link rel="stylesheet" href=""/>

  <!-- Firepad -->
  <link rel="stylesheet" href="" />
  <script src=""></script>

Then, you need to initialize the Firebase SDK and Firepad:

<body onload="init()">
  <div id="firepad"></div>
    function init() {
      // Initialize the Firebase SDK.
        apiKey: '<API_KEY>',
        databaseURL: 'https://<DATABASE_NAME>'

      // Get Firebase Database reference.
      var firepadRef = firebase.database().ref();

      // Create CodeMirror (with lineWrapping on).
      var codeMirror = CodeMirror(document.getElementById('firepad'), { lineWrapping: true });

      // Create Firepad (with rich text toolbar and shortcuts enabled).
      var firepad = Firepad.fromCodeMirror(firepadRef, codeMirror,
          { richTextShortcuts: true, richTextToolbar: true, defaultText: 'Hello, World!' });


Firepad supports rich text editing with CodeMirror and code editing via Ace. Check out the detailed setup instructions at


You can find some Firepad examples here.


If you'd like to contribute to Firepad, please first read through our contribution guidelines. Local setup instructions are available here.

Repo Structure

Here are some highlights of the directory structure and notable source files:

  • dist/ - output directory for all files generated by grunt (firepad.js, firepad.min.js, firepad.css, firepad.eot).
  • examples/ - examples of embedding Firepad.
  • font/ - icon font used for rich text toolbar.
  • lib/
    • firepad.js - Entry point for Firepad.
    • text-operation.js, client.js - Heart of the Operation Transformation implementation. Based on ot.js but extended to allow arbitrary attributes on text (for representing rich-text).
    • annotation-list.js - A data model for representing annotations on text (i.e. spans of text with a particular set of attributes).
    • rich-text-codemirror.js - Uses AnnotationList to track annotations on the text and maintain the appropriate set of markers on a CodeMirror instance.
    • firebase-adapter.js - Handles integration with Firebase (appending operations, triggering retries, presence, etc.).
  • test/ - Jasmine tests for Firepad (many of these were borrowed from ot.js).
You can’t perform that action at this time.