Short answer
Find the field that is growing. Move images and files to Cloud Storage and save only the path or URL. Move lists that grow, such as chat messages or events, to a subcollection with one document per item. Split a large map into separate documents.
Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.
Why the document is too large, and the fix
01
A file is stored in the document
“Maximum size for a document 1 MiB (1,048,576 bytes)” Firebase, Usage and limits
Base64 makes a file about a third bigger, so a photo of under 1 MB can still break the limit. Upload the file to Cloud Storage and save its path in the document.
02
A list keeps growing in one document
Chat messages, comments or logs added with arrayUnion grow until the writes start failing. Store each item as its own document in a subcollection, and add security rules for the new path.
// one document per message, not one growing array await addDoc(collection(db, 'chats', chatId, 'messages'), { text, senderId: user.uid, createdAt: serverTimestamp(), });03
Several big fields add up
“For example, four fields of 256 KiB each exceed the limit.” Google Cloud, Error codes (INVALID_ARGUMENT)
The limit applies to the whole document, so fields that are fine on their own can be too much together. Split them into separate documents.
04
Text is counted in bytes, not characters
“String sizes are calculated as the number of UTF-8 encoded bytes + 1.” Firebase, Storage size calculations
Field names and string values are counted as UTF-8 bytes, so emoji and non-Latin text use more space than they look. Long field names in big maps add up too.
Checked against the vendor’s docs on : Firebase docs: Usage and limits; Google Cloud docs: Firestore error codes; Firebase docs: Storage size calculations.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Firestore transaction too big · Firestore quota exceeded · Firestore in query limit (30) · Firestore ALREADY_EXISTS