Export JSON from Firebase Firestore
Export JSON from Firebase Firestore
Cloud Firestore data has a nested JSON-like structure, but there’s no way to export documents or collections to JSON via the Firebase Console. It’s not even possible to copy data from the web interface to the clipboard, you had to write custom scripts for these kinds of things.
That’s one of the reasons we created Firefoo, a Firebase GUI client for your desktop that can export collections and documents to JSON files among others.
Download and install Firefoo
If prompted, sign in with Google
This happens automatically if you have used the Firebase CLI on your machine
Right-click the collection in the sidebar and select Export Collection

Make sure the JSON Format is selected and click the Export button

You can export the results of a specific query with where and order-by clauses to JSON.
Click the collection in the sidebar on the left
Add Where conditions and Order by clauses. Adjust the number of documents with the Limit field, click the Run button to run your query!
Click the Export Results icon as seen in the screenshot below

Select the file destination in the file chooser
If you want to export a single subcollection to JSON, instead of one of the root-level collections, that’s also possible! Subcollections are not shown in the sidebar. That’s why you have to locate the subcollection in the Tree view (not the Table view) and open the right-click context menu from there. Choose Export and the same export dialog as above appears.
Firestore type | JSON representation | Example |
---|---|---|
Array | [] | [1,2,"yellow"] |
Boolean | boolean | false |
Bytes | { "__datatype__": "bytes", "value": string }value is a base64 encoded Buffer | { "__datatype__": "bytes", "value": "AA//AA==" } |
Timestamp | { "__datatype__": "timestamp", "value": string } | { "__datatype__": "timestamp", "value": "2021-06-02T13:49:20.460850Z" } |
Double | number64-bit double precision, IEEE 754 | 1337.42 |
Geopoint | { "__datatype__": "geopoint", "value": { "_latitude": number, "_longitude": number } }_latitude and _longitude in degrees | { "__datatype__": "geopoint", "value": { "_latitude": 33.12321, "_longitude": 12.244411 } } |
Integer | number64bit signed | 324375436234 |
Map | {}json object with alphabetically-sorted keys | { "key1": "hello", "key2": true } |
Null | null | null |
Doc Reference | { "__datatype__": "documentreference", "value": string } | { "__datatype__": "documentreference", "value": "coll/docId/subColl/deepDocId" } |
String | string | "hello world" |
{
"__id__": "JoelMacGyver",
"address": {
"city": "East Rozellaberg",
"country": "Costa Rica",
"street": "581 Yazmin Wells"
},
"birthday": {
"__datatype__": "timestamp",
"value": "2021-06-02T13:49:20.460850Z"
},
"devices": [
"iPhone",
"PC"
],
"firstName": "Joel",
"height": 1.82,
"jobTitle": "Regional Tactics Supervisor",
"lastName": "MacGyver",
"location": {
"__datatype__": "geopoint",
"value": {
"_latitude": 23.512495615448177,
"_longitude": 84.98532027801551
}
}
}
Firefoo uses two read requests for every document that is exported. The first to fetch the data, the second to check for subcollections. If you unselect the Include Subcollections option, only one request is necessary, saving half of the total requests!
Right-click on the target database in the sidebar and select Import Collections. In the Import Dialog, choose the JSON file and specify the target collection name in the Target Path field.