Storage size calculations Stay organized with collections Save and categorize content based on your preferences.
This page describes the storage size of documents, document names, fields, andindex entries inCloud Firestore.
You can learn about the costs of this storage atCloud FirestorePricing.String size
String sizes are calculated as the number ofUTF-8 encoded bytes + 1.
The following are stored as strings:
- Collection IDs
- String document IDs
- Document names
- Field names
- String field values
For example:
- The collection ID
tasksuses 5 bytes + 1 byte, for a total of 6 bytes. - The field name
descriptionuses 11 bytes + 1 byte, for a total of 12bytes.
Document ID size
The size of a document ID is either thestring size for a stringID or 8 bytes for an integer ID.
Note: TheCloud Firestore client libraries always use string documentIDs.Document name size
The size of a document name is the sum of:
- The size of each collection ID and document ID in the path to the document
- 16 additional bytes
For a document in the subcollectionusers/jeff/tasks with a string document IDofmy_task_id, the document name size is 6 + 5 + 6 + 11 + 16 = 44 bytes:
- 6 bytes for the
userscollection ID - 5 bytes for the
jeffdocument ID - 6 bytes for the
taskscollection ID - 11 bytes for the
my_task_iddocument ID - 16 additional bytes
users/jeff/tasks/my_task_id/comments/D8PvloqiczrzXik3SWjZ, aren't counted towards the document name size or the 1 MiB limit for theusers/jeff/tasks/my_task_id document.Field value size
The following table shows the size of field values by type.
| Type | Size |
|---|---|
| Array | The sum of the sizes of its values |
| Boolean | 1 byte |
| Bytes | Byte length |
| Date and time | 8 bytes |
| Floating-point number | 8 bytes |
| Geographical point | 16 bytes |
| Integer | 8 bytes |
| Map | The size of the map, calculated the same way asdocument size |
| Null | 1 byte |
| Reference | Thedocument name size |
| Text string | Number of UTF-8 encoded bytes + 1 |
| Vector | 8 bytes per dimension |
For example, a boolean field nameddone would use 6 bytes:
- 5 bytes for the
donefield name - 1 byte for the boolean value
Document size
The size of a document is the sum of:
- Thedocument name size
- The sum of thestring size of each field name
- The sum of the size of eachfield value
- 32 additional bytes
This example is for a document in subcollectionusers/jeff/taskswith a string document ID ofmy_task_id:
- "type": "Personal" - "done": false - "priority": 1 - "description": "Learn Cloud Firestore"
The total size of the fields is 71 bytes:
| Field name and value | Field size in bytes |
|---|---|
"type": "Personal" | 14 5 for the field name + 9 for the field's string value |
"done": false | 6 5 for the field name + 1 for the field's boolean value |
"priority": 1 | 17 9 for the field name + 8 for the field's integer value |
"description": "Learn Cloud Firestore" | 34 12 for the field name + 22 for the field's string value |
So the document size is 44 + 71 + 32 = 147 bytes:
- 44 bytes for the document name
- 71 bytes for the fields
- 32 additional bytes
users/jeff/tasks/my_task_id/comments/D8PvloqiczrzXik3SWjZ, aren't counted towards the document name size or the 1 MiB limit for theusers/jeff/tasks/my_task_id document.Index entry size
Index entry sizes are calculated as follows for single-field and compositeindexes.
Single-field index entry size
The size of a single-field index entry depends on whether an index is scoped toa collection or a collection group.
Collection scope
The size of an entry in a single-field index with collection scope is the sumof:
- Thedocument name size of the indexed document
- Thedocument name size of the indexed document's parentdocument
- Thestring size of the indexed field name
- The size of the indexedfield value
- 32 additional bytes
Consider a document in the sub-collectionusers/jeff/tasks witha string document ID ofmy_task_id:
- "type": "Personal" - "done": false - "priority": 1 - "description": "Learn Cloud Firestore"
For a single-field index with collection scope that indexes thedonefield, the total size of the entry in this index is 109 bytes:
- 44 bytes for the document name
users/jeff/tasks/my_task_id - 27 bytes for the parent document's document name
users/jeff - 5 bytes for the
donefield name - 1 byte for the boolean field value
- 32 additional bytes
Collection group scope
The size of an entry in a single-field index with collection group scope is thesum of:
- Thedocument name size of the indexed document
- Thestring size of the indexed field name
- The size of the indexedfield value
- 48 additional bytes
Consider a document in the sub-collectionusers/jeff/tasks witha string document ID ofmy_task_id:
- "type": "Personal" - "done": false - "priority": 1 - "description": "Learn Cloud Firestore"
For a single-field index with collection group scope that indexes thedonefield, the total size of the entry in this index is 98 bytes:
- 44 bytes for the document name
users/jeff/tasks/my_task_id - 5 bytes for the
donefield name - 1 byte for the boolean field value
- 48 additional bytes
Composite index entry size
The size of an entry in a composite index depends on whether the index is scopedto a collection or a collection group.
Collection scope
The size of an index entry in a composite index with collection scope is thesum of:
- Thedocument name size of the indexed document
- Thedocument name size of the indexed document's parentdocument
- The sum of the indexedfield values
- 32 additional bytes
Consider a document in the sub-collectionusers/jeff/tasks witha string document ID ofmy_task_id:
- "type": "Personal" - "done": false - "priority": 1 - "description": "Learn Cloud Firestore"
For a composite index with collection scope that indexes thedone andpriority fields (both ascending), the total size of the entry in this index is112 bytes:
- 44 bytes for the document name
users/jeff/tasks/my_task_id - 27 bytes for the parent document's document name
users/jeff - 1 byte for the boolean field value
- 8 bytes for the integer field value
- 32 additional bytes
Collection group scope
The size of an index entry in a composite index with collection group scope isthe sum of:
- Thedocument name size of the indexed document
- The sum of the indexedfield values
- 32 additional bytes
Consider a document in the sub-collectionusers/jeff/tasks witha string document ID ofmy_task_id:
- "type": "Personal" - "done": false - "priority": 1 - "description": "Learn Cloud Firestore"
For a composite index with collection group scope that indexes thedone andpriority fields (both ascending), the total size of the index entry in thisindex is 85 bytes:
- 44 bytes for the document name
users/jeff/tasks/my_task_id - 1 byte for the boolean field value
- 8 bytes for the integer field value
- 32 additional bytes
What's next
Learn aboutCloud Firestore pricing.Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.